File tree Expand file tree Collapse file tree 2 files changed +25
-4
lines changed
Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -840,6 +840,27 @@ then
840840 exit 1
841841fi
842842
843+ test_lazy_prereq NESTED_INNER '
844+ >inner &&
845+ rm -f outer
846+ '
847+ test_lazy_prereq NESTED_PREREQ '
848+ >outer &&
849+ test_have_prereq NESTED_INNER &&
850+ echo "can create new file in cwd" >file &&
851+ test -f outer &&
852+ test ! -f inner
853+ '
854+ test_expect_success NESTED_PREREQ ' evaluating nested lazy prereqs dont interfere with each other' '
855+ nestedworks=yes
856+ '
857+
858+ if test -z " $GIT_TEST_FAIL_PREREQS_INTERNAL " && test " $nestedworks " ! = yes
859+ then
860+ say ' bug in test framework: nested lazy prerequisites do not work'
861+ exit 1
862+ fi
863+
843864test_expect_success ' lazy prereqs do not turn off tracing' "
844865 run_sub_test_lib_test lazy-prereq-and-tracing \
845866 'lazy prereqs and -x' -v -x <<-\\ EOF &&
Original file line number Diff line number Diff line change @@ -423,7 +423,7 @@ write_script () {
423423# - Explicitly using test_have_prereq.
424424#
425425# - Implicitly by specifying the prerequisite tag in the calls to
426- # test_expect_{success,failure,code }.
426+ # test_expect_{success,failure} and test_external{,_without_stderr }.
427427#
428428# The single parameter is the prerequisite tag (a simple word, in all
429429# capital letters by convention).
@@ -474,15 +474,15 @@ test_lazy_prereq () {
474474
475475test_run_lazy_prereq_ () {
476476 script='
477- mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
477+ mkdir -p "$TRASH_DIRECTORY/prereq-test-dir- ' " $1 " ' " &&
478478(
479- cd "$TRASH_DIRECTORY/prereq-test-dir" &&' " $2 " '
479+ cd "$TRASH_DIRECTORY/prereq-test-dir- ' " $1 " ' " &&' " $2 " '
480480)'
481481 say >&3 " checking prerequisite: $1 "
482482 say >&3 " $script "
483483 test_eval_ " $script "
484484 eval_ret=$?
485- rm -rf " $TRASH_DIRECTORY /prereq-test-dir"
485+ rm -rf " $TRASH_DIRECTORY /prereq-test-dir- $1 "
486486 if test " $eval_ret " = 0; then
487487 say >&3 " prerequisite $1 ok"
488488 else
You can’t perform that action at this time.
0 commit comments