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
840
840
exit 1
841
841
fi
842
842
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
+
843
864
test_expect_success ' lazy prereqs do not turn off tracing' "
844
865
run_sub_test_lib_test lazy-prereq-and-tracing \
845
866
'lazy prereqs and -x' -v -x <<-\\ EOF &&
Original file line number Diff line number Diff line change @@ -423,7 +423,7 @@ write_script () {
423
423
# - Explicitly using test_have_prereq.
424
424
#
425
425
# - 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 }.
427
427
#
428
428
# The single parameter is the prerequisite tag (a simple word, in all
429
429
# capital letters by convention).
@@ -474,15 +474,15 @@ test_lazy_prereq () {
474
474
475
475
test_run_lazy_prereq_ () {
476
476
script='
477
- mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
477
+ mkdir -p "$TRASH_DIRECTORY/prereq-test-dir- ' " $1 " ' " &&
478
478
(
479
- cd "$TRASH_DIRECTORY/prereq-test-dir" &&' " $2 " '
479
+ cd "$TRASH_DIRECTORY/prereq-test-dir- ' " $1 " ' " &&' " $2 " '
480
480
)'
481
481
say >&3 " checking prerequisite: $1 "
482
482
say >&3 " $script "
483
483
test_eval_ " $script "
484
484
eval_ret=$?
485
- rm -rf " $TRASH_DIRECTORY /prereq-test-dir"
485
+ rm -rf " $TRASH_DIRECTORY /prereq-test-dir- $1 "
486
486
if test " $eval_ret " = 0; then
487
487
say >&3 " prerequisite $1 ok"
488
488
else
You can’t perform that action at this time.
0 commit comments