t0000: consistently use single quotes for outer tests

When we use the sub-test helpers, we end up defining one shell snippet inside another shell snippet. So if we use single-quotes for the outer snippet, we have to use double-quotes within the inner snippet (it's included as here-doc within the outer snippet, but using a single quote would end the outer snippet early). Or vice versa we can use double quotes for the outer snippet, but then single quotes in the inner. We have some of each in the script, and neither is wrong. But it would be nice to be consistent unless there is a good reason not to. Using single quotes for the outer script is preferable, because it requires less metacharacter quoting overall. For example, in: test_expect_success 'outer' ' run_sub_test_lib_test ... <<-\EOF echo $foo && test_expect_success "inner" " echo \$bar " EOF ' we need only quote inside "inner", but not inside "outer" or the here-doc. Whereas if we flip them, we have to quote in both places: test_expect_success 'outer' " run_sub_test_lib_test ... <<-\EOF echo \$foo && test_expect_success 'inner' ' echo \$bar ' EOF " The exception is when we need a literal single-quote in an expected output here-doc. There we can either use outer double-quotes, or just use ${SQ} within the doc. I chose the latter for consistency (within this test, but also with other test scripts that face the same problem). There is one other interesting case, which is some tests that do: test_expect_success ... " do_something --run='"'!3'"' " This is rather confusing to read, but is correct. The outer script sees '!3' in single-quotes, as does the eval'd snippet. This is perhaps being overly cautious. In many interactive shells, an exclamation triggers history expansion even inside double quotes, but that is not generally true in non-interactive shells. There's some conflicting information here. Commit 784ce03d55 (t4216: avoid unnecessary subshell in test_bloom_filters_not_used, 2020-05-19) reports it as a problem with OpenBSD 6.7's /bin/sh. However, we have many instances in this script of prereqs like !LAZY_TRUE, which haven't been a problem. I left them un-escaped here to test out this theory. It's much nicer if we can not worry about this as a portability issue, so it's worth knowing. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Jan 28, 2021 at 01:32 UTC 30291525d9e8887348cf43195ff34ee79d3820e6
1 file changed +190 -190
t/t0000-basic.sh
+190 -190
@@ -135,32 +135,32 @@ check_sub_test_lib_test_err () {
135 )
136 }
137
138 -test_expect_success 'pretend we have a fully passing test suite' "
139 - run_sub_test_lib_test full-pass '3 passing tests' <<-\\EOF &&
138 +test_expect_success 'pretend we have a fully passing test suite' '
139 + run_sub_test_lib_test full-pass "3 passing tests" <<-\EOF &&
140 for i in 1 2 3
141 do
142 - test_expect_success \"passing test #\$i\" 'true'
142 + test_expect_success "passing test #$i" "true"
143 done
144 test_done
145 EOF
146 - check_sub_test_lib_test full-pass <<-\\EOF
146 + check_sub_test_lib_test full-pass <<-\EOF
147 > ok 1 - passing test #1
148 > ok 2 - passing test #2
149 > ok 3 - passing test #3
150 > # passed all 3 test(s)
151 > 1..3
152 EOF
153 -"
153 +'
154
155 -test_expect_success 'pretend we have a partially passing test suite' "
155 +test_expect_success 'pretend we have a partially passing test suite' '
156 run_sub_test_lib_test_err \
157 - partial-pass '2/3 tests passing' <<-\\EOF &&
158 - test_expect_success 'passing test #1' 'true'
159 - test_expect_success 'failing test #2' 'false'
160 - test_expect_success 'passing test #3' 'true'
157 + partial-pass "2/3 tests passing" <<-\EOF &&
158 + test_expect_success "passing test #1" "true"
159 + test_expect_success "failing test #2" "false"
160 + test_expect_success "passing test #3" "true"
161 test_done
162 EOF
163 - check_sub_test_lib_test partial-pass <<-\\EOF
163 + check_sub_test_lib_test partial-pass <<-\EOF
164 > ok 1 - passing test #1
165 > not ok 2 - failing test #2
166 # false
@@ -168,44 +168,44 @@ test_expect_success 'pretend we have a partially passing test suite' "
168 > # failed 1 among 3 test(s)
169 > 1..3
170 EOF
171 -"
171 +'
172
173 -test_expect_success 'pretend we have a known breakage' "
174 - run_sub_test_lib_test failing-todo 'A failing TODO test' <<-\\EOF &&
175 - test_expect_success 'passing test' 'true'
176 - test_expect_failure 'pretend we have a known breakage' 'false'
173 +test_expect_success 'pretend we have a known breakage' '
174 + run_sub_test_lib_test failing-todo "A failing TODO test" <<-\EOF &&
175 + test_expect_success "passing test" "true"
176 + test_expect_failure "pretend we have a known breakage" "false"
177 test_done
178 EOF
179 - check_sub_test_lib_test failing-todo <<-\\EOF
179 + check_sub_test_lib_test failing-todo <<-\EOF
180 > ok 1 - passing test
181 > not ok 2 - pretend we have a known breakage # TODO known breakage
182 > # still have 1 known breakage(s)
183 > # passed all remaining 1 test(s)
184 > 1..2
185 EOF
186 -"
186 +'
187
188 -test_expect_success 'pretend we have fixed a known breakage' "
189 - run_sub_test_lib_test passing-todo 'A passing TODO test' <<-\\EOF &&
190 - test_expect_failure 'pretend we have fixed a known breakage' 'true'
188 +test_expect_success 'pretend we have fixed a known breakage' '
189 + run_sub_test_lib_test passing-todo "A passing TODO test" <<-\EOF &&
190 + test_expect_failure "pretend we have fixed a known breakage" "true"
191 test_done
192 EOF
193 - check_sub_test_lib_test passing-todo <<-\\EOF
193 + check_sub_test_lib_test passing-todo <<-\EOF
194 > ok 1 - pretend we have fixed a known breakage # TODO known breakage vanished
195 > # 1 known breakage(s) vanished; please update test(s)
196 > 1..1
197 EOF
198 -"
198 +'
199
200 -test_expect_success 'pretend we have fixed one of two known breakages (run in sub test-lib)' "
200 +test_expect_success 'pretend we have fixed one of two known breakages (run in sub test-lib)' '
201 run_sub_test_lib_test partially-passing-todos \
202 - '2 TODO tests, one passing' <<-\\EOF &&
203 - test_expect_failure 'pretend we have a known breakage' 'false'
204 - test_expect_success 'pretend we have a passing test' 'true'
205 - test_expect_failure 'pretend we have fixed another known breakage' 'true'
202 + "2 TODO tests, one passing" <<-\EOF &&
203 + test_expect_failure "pretend we have a known breakage" "false"
204 + test_expect_success "pretend we have a passing test" "true"
205 + test_expect_failure "pretend we have fixed another known breakage" "true"
206 test_done
207 EOF
208 - check_sub_test_lib_test partially-passing-todos <<-\\EOF
208 + check_sub_test_lib_test partially-passing-todos <<-\EOF
209 > not ok 1 - pretend we have a known breakage # TODO known breakage
210 > ok 2 - pretend we have a passing test
211 > ok 3 - pretend we have fixed another known breakage # TODO known breakage vanished
@@ -214,17 +214,17 @@ test_expect_success 'pretend we have fixed one of two known breakages (run in su
214 > # passed all remaining 1 test(s)
215 > 1..3
216 EOF
217 -"
217 +'
218
219 -test_expect_success 'pretend we have a pass, fail, and known breakage' "
219 +test_expect_success 'pretend we have a pass, fail, and known breakage' '
220 run_sub_test_lib_test_err \
221 - mixed-results1 'mixed results #1' <<-\\EOF &&
222 - test_expect_success 'passing test' 'true'
223 - test_expect_success 'failing test' 'false'
224 - test_expect_failure 'pretend we have a known breakage' 'false'
221 + mixed-results1 "mixed results #1" <<-\EOF &&
222 + test_expect_success "passing test" "true"
223 + test_expect_success "failing test" "false"
224 + test_expect_failure "pretend we have a known breakage" "false"
225 test_done
226 EOF
227 - check_sub_test_lib_test mixed-results1 <<-\\EOF
227 + check_sub_test_lib_test mixed-results1 <<-\EOF
228 > ok 1 - passing test
229 > not ok 2 - failing test
230 > # false
@@ -233,24 +233,24 @@ test_expect_success 'pretend we have a pass, fail, and known breakage' "
233 > # failed 1 among remaining 2 test(s)
234 > 1..3
235 EOF
236 -"
236 +'
237
238 -test_expect_success 'pretend we have a mix of all possible results' "
238 +test_expect_success 'pretend we have a mix of all possible results' '
239 run_sub_test_lib_test_err \
240 - mixed-results2 'mixed results #2' <<-\\EOF &&
241 - test_expect_success 'passing test' 'true'
242 - test_expect_success 'passing test' 'true'
243 - test_expect_success 'passing test' 'true'
244 - test_expect_success 'passing test' 'true'
245 - test_expect_success 'failing test' 'false'
246 - test_expect_success 'failing test' 'false'
247 - test_expect_success 'failing test' 'false'
248 - test_expect_failure 'pretend we have a known breakage' 'false'
249 - test_expect_failure 'pretend we have a known breakage' 'false'
250 - test_expect_failure 'pretend we have fixed a known breakage' 'true'
240 + mixed-results2 "mixed results #2" <<-\EOF &&
241 + test_expect_success "passing test" "true"
242 + test_expect_success "passing test" "true"
243 + test_expect_success "passing test" "true"
244 + test_expect_success "passing test" "true"
245 + test_expect_success "failing test" "false"
246 + test_expect_success "failing test" "false"
247 + test_expect_success "failing test" "false"
248 + test_expect_failure "pretend we have a known breakage" "false"
249 + test_expect_failure "pretend we have a known breakage" "false"
250 + test_expect_failure "pretend we have fixed a known breakage" "true"
251 test_done
252 EOF
253 - check_sub_test_lib_test mixed-results2 <<-\\EOF
253 + check_sub_test_lib_test mixed-results2 <<-\EOF
254 > ok 1 - passing test
255 > ok 2 - passing test
256 > ok 3 - passing test
@@ -269,7 +269,7 @@ test_expect_success 'pretend we have a mix of all possible results' "
269 > # failed 3 among remaining 7 test(s)
270 > 1..10
271 EOF
272 -"
272 +'
273
274 test_expect_success C_LOCALE_OUTPUT 'test --verbose' '
275 run_sub_test_lib_test_err \
@@ -321,18 +321,18 @@ test_expect_success 'test --verbose-only' '
321 EOF
322 '
323
324 -test_expect_success 'GIT_SKIP_TESTS' "
324 +test_expect_success 'GIT_SKIP_TESTS' '
325 (
326 - GIT_SKIP_TESTS='git.2' && export GIT_SKIP_TESTS &&
326 + GIT_SKIP_TESTS="git.2" && export GIT_SKIP_TESTS &&
327 run_sub_test_lib_test git-skip-tests-basic \
328 - 'GIT_SKIP_TESTS' <<-\\EOF &&
328 + "GIT_SKIP_TESTS" <<-\EOF &&
329 for i in 1 2 3
330 do
331 - test_expect_success \"passing test #\$i\" 'true'
331 + test_expect_success "passing test #$i" "true"
332 done
333 test_done
334 EOF
335 - check_sub_test_lib_test git-skip-tests-basic <<-\\EOF
335 + check_sub_test_lib_test git-skip-tests-basic <<-\EOF
336 > ok 1 - passing test #1
337 > ok 2 # skip passing test #2 (GIT_SKIP_TESTS)
338 > ok 3 - passing test #3
@@ -340,20 +340,20 @@ test_expect_success 'GIT_SKIP_TESTS' "
340 > 1..3
341 EOF
342 )
343 -"
343 +'
344
345 -test_expect_success 'GIT_SKIP_TESTS several tests' "
345 +test_expect_success 'GIT_SKIP_TESTS several tests' '
346 (
347 - GIT_SKIP_TESTS='git.2 git.5' && export GIT_SKIP_TESTS &&
347 + GIT_SKIP_TESTS="git.2 git.5" && export GIT_SKIP_TESTS &&
348 run_sub_test_lib_test git-skip-tests-several \
349 - 'GIT_SKIP_TESTS several tests' <<-\\EOF &&
349 + "GIT_SKIP_TESTS several tests" <<-\EOF &&
350 for i in 1 2 3 4 5 6
351 do
352 - test_expect_success \"passing test #\$i\" 'true'
352 + test_expect_success "passing test #$i" "true"
353 done
354 test_done
355 EOF
356 - check_sub_test_lib_test git-skip-tests-several <<-\\EOF
356 + check_sub_test_lib_test git-skip-tests-several <<-\EOF
357 > ok 1 - passing test #1
358 > ok 2 # skip passing test #2 (GIT_SKIP_TESTS)
359 > ok 3 - passing test #3
@@ -364,20 +364,20 @@ test_expect_success 'GIT_SKIP_TESTS several tests' "
364 > 1..6
365 EOF
366 )
367 -"
367 +'
368
369 -test_expect_success 'GIT_SKIP_TESTS sh pattern' "
369 +test_expect_success 'GIT_SKIP_TESTS sh pattern' '
370 (
371 - GIT_SKIP_TESTS='git.[2-5]' && export GIT_SKIP_TESTS &&
371 + GIT_SKIP_TESTS="git.[2-5]" && export GIT_SKIP_TESTS &&
372 run_sub_test_lib_test git-skip-tests-sh-pattern \
373 - 'GIT_SKIP_TESTS sh pattern' <<-\\EOF &&
373 + "GIT_SKIP_TESTS sh pattern" <<-\EOF &&
374 for i in 1 2 3 4 5 6
375 do
376 - test_expect_success \"passing test #\$i\" 'true'
376 + test_expect_success "passing test #$i" "true"
377 done
378 test_done
379 EOF
380 - check_sub_test_lib_test git-skip-tests-sh-pattern <<-\\EOF
380 + check_sub_test_lib_test git-skip-tests-sh-pattern <<-\EOF
381 > ok 1 - passing test #1
382 > ok 2 # skip passing test #2 (GIT_SKIP_TESTS)
383 > ok 3 # skip passing test #3 (GIT_SKIP_TESTS)
@@ -388,37 +388,37 @@ test_expect_success 'GIT_SKIP_TESTS sh pattern' "
388 > 1..6
389 EOF
390 )
391 -"
391 +'
392
393 -test_expect_success 'GIT_SKIP_TESTS entire suite' "
393 +test_expect_success 'GIT_SKIP_TESTS entire suite' '
394 (
395 - GIT_SKIP_TESTS='git' && export GIT_SKIP_TESTS &&
395 + GIT_SKIP_TESTS="git" && export GIT_SKIP_TESTS &&
396 run_sub_test_lib_test git-skip-tests-entire-suite \
397 - 'GIT_SKIP_TESTS entire suite' <<-\\EOF &&
397 + "GIT_SKIP_TESTS entire suite" <<-\EOF &&
398 for i in 1 2 3
399 do
400 - test_expect_success \"passing test #\$i\" 'true'
400 + test_expect_success "passing test #$i" "true"
401 done
402 test_done
403 EOF
404 - check_sub_test_lib_test git-skip-tests-entire-suite <<-\\EOF
404 + check_sub_test_lib_test git-skip-tests-entire-suite <<-\EOF
405 > 1..0 # SKIP skip all tests in git
406 EOF
407 )
408 -"
408 +'
409
410 -test_expect_success 'GIT_SKIP_TESTS does not skip unmatched suite' "
410 +test_expect_success 'GIT_SKIP_TESTS does not skip unmatched suite' '
411 (
412 - GIT_SKIP_TESTS='notgit' && export GIT_SKIP_TESTS &&
412 + GIT_SKIP_TESTS="notgit" && export GIT_SKIP_TESTS &&
413 run_sub_test_lib_test git-skip-tests-unmatched-suite \
414 - 'GIT_SKIP_TESTS does not skip unmatched suite' <<-\\EOF &&
414 + "GIT_SKIP_TESTS does not skip unmatched suite" <<-\EOF &&
415 for i in 1 2 3
416 do
417 - test_expect_success \"passing test #\$i\" 'true'
417 + test_expect_success "passing test #$i" "true"
418 done
419 test_done
420 EOF
421 - check_sub_test_lib_test git-skip-tests-unmatched-suite <<-\\EOF
421 + check_sub_test_lib_test git-skip-tests-unmatched-suite <<-\EOF
422 > ok 1 - passing test #1
423 > ok 2 - passing test #2
424 > ok 3 - passing test #3
@@ -426,18 +426,18 @@ test_expect_success 'GIT_SKIP_TESTS does not skip unmatched suite' "
426 > 1..3
427 EOF
428 )
429 -"
429 +'
430
431 -test_expect_success '--run basic' "
431 +test_expect_success '--run basic' '
432 run_sub_test_lib_test run-basic \
433 - '--run basic' --run='1,3,5' <<-\\EOF &&
433 + "--run basic" --run="1,3,5" <<-\EOF &&
434 for i in 1 2 3 4 5 6
435 do
436 - test_expect_success \"passing test #\$i\" 'true'
436 + test_expect_success "passing test #$i" "true"
437 done
438 test_done
439 EOF
440 - check_sub_test_lib_test run-basic <<-\\EOF
440 + check_sub_test_lib_test run-basic <<-\EOF
441 > ok 1 - passing test #1
442 > ok 2 # skip passing test #2 (--run)
443 > ok 3 - passing test #3
@@ -447,18 +447,18 @@ test_expect_success '--run basic' "
447 > # passed all 6 test(s)
448 > 1..6
449 EOF
450 -"
450 +'
451
452 -test_expect_success '--run with a range' "
452 +test_expect_success '--run with a range' '
453 run_sub_test_lib_test run-range \
454 - '--run with a range' --run='1-3' <<-\\EOF &&
454 + "--run with a range" --run="1-3" <<-\EOF &&
455 for i in 1 2 3 4 5 6
456 do
457 - test_expect_success \"passing test #\$i\" 'true'
457 + test_expect_success "passing test #$i" "true"
458 done
459 test_done
460 EOF
461 - check_sub_test_lib_test run-range <<-\\EOF
461 + check_sub_test_lib_test run-range <<-\EOF
462 > ok 1 - passing test #1
463 > ok 2 - passing test #2
464 > ok 3 - passing test #3
@@ -468,18 +468,18 @@ test_expect_success '--run with a range' "
468 > # passed all 6 test(s)
469 > 1..6
470 EOF
471 -"
471 +'
472
473 -test_expect_success '--run with two ranges' "
473 +test_expect_success '--run with two ranges' '
474 run_sub_test_lib_test run-two-ranges \
475 - '--run with two ranges' --run='1-2,5-6' <<-\\EOF &&
475 + "--run with two ranges" --run="1-2,5-6" <<-\EOF &&
476 for i in 1 2 3 4 5 6
477 do
478 - test_expect_success \"passing test #\$i\" 'true'
478 + test_expect_success "passing test #$i" "true"
479 done
480 test_done
481 EOF
482 - check_sub_test_lib_test run-two-ranges <<-\\EOF
482 + check_sub_test_lib_test run-two-ranges <<-\EOF
483 > ok 1 - passing test #1
484 > ok 2 - passing test #2
485 > ok 3 # skip passing test #3 (--run)
@@ -489,18 +489,18 @@ test_expect_success '--run with two ranges' "
489 > # passed all 6 test(s)
490 > 1..6
491 EOF
492 -"
492 +'
493
494 -test_expect_success '--run with a left open range' "
494 +test_expect_success '--run with a left open range' '
495 run_sub_test_lib_test run-left-open-range \
496 - '--run with a left open range' --run='-3' <<-\\EOF &&
496 + "--run with a left open range" --run="-3" <<-\EOF &&
497 for i in 1 2 3 4 5 6
498 do
499 - test_expect_success \"passing test #\$i\" 'true'
499 + test_expect_success "passing test #$i" "true"
500 done
501 test_done
502 EOF
503 - check_sub_test_lib_test run-left-open-range <<-\\EOF
503 + check_sub_test_lib_test run-left-open-range <<-\EOF
504 > ok 1 - passing test #1
505 > ok 2 - passing test #2
506 > ok 3 - passing test #3
@@ -510,18 +510,18 @@ test_expect_success '--run with a left open range' "
510 > # passed all 6 test(s)
511 > 1..6
512 EOF
513 -"
513 +'
514
515 -test_expect_success '--run with a right open range' "
515 +test_expect_success '--run with a right open range' '
516 run_sub_test_lib_test run-right-open-range \
517 - '--run with a right open range' --run='4-' <<-\\EOF &&
517 + "--run with a right open range" --run="4-" <<-\EOF &&
518 for i in 1 2 3 4 5 6
519 do
520 - test_expect_success \"passing test #\$i\" 'true'
520 + test_expect_success "passing test #$i" "true"
521 done
522 test_done
523 EOF
524 - check_sub_test_lib_test run-right-open-range <<-\\EOF
524 + check_sub_test_lib_test run-right-open-range <<-\EOF
525 > ok 1 # skip passing test #1 (--run)
526 > ok 2 # skip passing test #2 (--run)
527 > ok 3 # skip passing test #3 (--run)
@@ -531,18 +531,18 @@ test_expect_success '--run with a right open range' "
531 > # passed all 6 test(s)
532 > 1..6
533 EOF
534 -"
534 +'
535
536 -test_expect_success '--run with basic negation' "
536 +test_expect_success '--run with basic negation' '
537 run_sub_test_lib_test run-basic-neg \
538 - '--run with basic negation' --run='"'!3'"' <<-\\EOF &&
538 + "--run with basic negation" --run="!3" <<-\EOF &&
539 for i in 1 2 3 4 5 6
540 do
541 - test_expect_success \"passing test #\$i\" 'true'
541 + test_expect_success "passing test #$i" "true"
542 done
543 test_done
544 EOF
545 - check_sub_test_lib_test run-basic-neg <<-\\EOF
545 + check_sub_test_lib_test run-basic-neg <<-\EOF
546 > ok 1 - passing test #1
547 > ok 2 - passing test #2
548 > ok 3 # skip passing test #3 (--run)
@@ -552,18 +552,18 @@ test_expect_success '--run with basic negation' "
552 > # passed all 6 test(s)
553 > 1..6
554 EOF
555 -"
555 +'
556
557 -test_expect_success '--run with two negations' "
557 +test_expect_success '--run with two negations' '
558 run_sub_test_lib_test run-two-neg \
559 - '--run with two negations' --run='"'!3,!6'"' <<-\\EOF &&
559 + "--run with two negations" --run="!3,!6" <<-\EOF &&
560 for i in 1 2 3 4 5 6
561 do
562 - test_expect_success \"passing test #\$i\" 'true'
562 + test_expect_success "passing test #$i" "true"
563 done
564 test_done
565 EOF
566 - check_sub_test_lib_test run-two-neg <<-\\EOF
566 + check_sub_test_lib_test run-two-neg <<-\EOF
567 > ok 1 - passing test #1
568 > ok 2 - passing test #2
569 > ok 3 # skip passing test #3 (--run)
@@ -573,18 +573,18 @@ test_expect_success '--run with two negations' "
573 > # passed all 6 test(s)
574 > 1..6
575 EOF
576 -"
576 +'
577
578 -test_expect_success '--run a range and negation' "
578 +test_expect_success '--run a range and negation' '
579 run_sub_test_lib_test run-range-and-neg \
580 - '--run a range and negation' --run='"'-4,!2'"' <<-\\EOF &&
580 + "--run a range and negation" --run="-4,!2" <<-\EOF &&
581 for i in 1 2 3 4 5 6
582 do
583 - test_expect_success \"passing test #\$i\" 'true'
583 + test_expect_success "passing test #$i" "true"
584 done
585 test_done
586 EOF
587 - check_sub_test_lib_test run-range-and-neg <<-\\EOF
587 + check_sub_test_lib_test run-range-and-neg <<-\EOF
588 > ok 1 - passing test #1
589 > ok 2 # skip passing test #2 (--run)
590 > ok 3 - passing test #3
@@ -594,18 +594,18 @@ test_expect_success '--run a range and negation' "
594 > # passed all 6 test(s)
595 > 1..6
596 EOF
597 -"
597 +'
598
599 -test_expect_success '--run range negation' "
599 +test_expect_success '--run range negation' '
600 run_sub_test_lib_test run-range-neg \
601 - '--run range negation' --run='"'!1-3'"' <<-\\EOF &&
601 + "--run range negation" --run="!1-3" <<-\EOF &&
602 for i in 1 2 3 4 5 6
603 do
604 - test_expect_success \"passing test #\$i\" 'true'
604 + test_expect_success "passing test #$i" "true"
605 done
606 test_done
607 EOF
608 - check_sub_test_lib_test run-range-neg <<-\\EOF
608 + check_sub_test_lib_test run-range-neg <<-\EOF
609 > ok 1 # skip passing test #1 (--run)
610 > ok 2 # skip passing test #2 (--run)
611 > ok 3 # skip passing test #3 (--run)
@@ -615,19 +615,19 @@ test_expect_success '--run range negation' "
615 > # passed all 6 test(s)
616 > 1..6
617 EOF
618 -"
618 +'
619
620 -test_expect_success '--run include, exclude and include' "
620 +test_expect_success '--run include, exclude and include' '
621 run_sub_test_lib_test run-inc-neg-inc \
622 - '--run include, exclude and include' \
623 - --run='"'1-5,!1-3,2'"' <<-\\EOF &&
622 + "--run include, exclude and include" \
623 + --run="1-5,!1-3,2" <<-\EOF &&
624 for i in 1 2 3 4 5 6
625 do
626 - test_expect_success \"passing test #\$i\" 'true'
626 + test_expect_success "passing test #$i" "true"
627 done
628 test_done
629 EOF
630 - check_sub_test_lib_test run-inc-neg-inc <<-\\EOF
630 + check_sub_test_lib_test run-inc-neg-inc <<-\EOF
631 > ok 1 # skip passing test #1 (--run)
632 > ok 2 - passing test #2
633 > ok 3 # skip passing test #3 (--run)
@@ -637,19 +637,19 @@ test_expect_success '--run include, exclude and include' "
637 > # passed all 6 test(s)
638 > 1..6
639 EOF
640 -"
640 +'
641
642 -test_expect_success '--run include, exclude and include, comma separated' "
642 +test_expect_success '--run include, exclude and include, comma separated' '
643 run_sub_test_lib_test run-inc-neg-inc-comma \
644 - '--run include, exclude and include, comma separated' \
645 - --run=1-5,\!1-3,2 <<-\\EOF &&
644 + "--run include, exclude and include, comma separated" \
645 + --run=1-5,!1-3,2 <<-\EOF &&
646 for i in 1 2 3 4 5 6
647 do
648 - test_expect_success \"passing test #\$i\" 'true'
648 + test_expect_success "passing test #$i" "true"
649 done
650 test_done
651 EOF
652 - check_sub_test_lib_test run-inc-neg-inc-comma <<-\\EOF
652 + check_sub_test_lib_test run-inc-neg-inc-comma <<-\EOF
653 > ok 1 # skip passing test #1 (--run)
654 > ok 2 - passing test #2
655 > ok 3 # skip passing test #3 (--run)
@@ -659,19 +659,19 @@ test_expect_success '--run include, exclude and include, comma separated' "
659 > # passed all 6 test(s)
660 > 1..6
661 EOF
662 -"
662 +'
663
664 -test_expect_success '--run exclude and include' "
664 +test_expect_success '--run exclude and include' '
665 run_sub_test_lib_test run-neg-inc \
666 - '--run exclude and include' \
667 - --run='"'!3-,5'"' <<-\\EOF &&
666 + "--run exclude and include" \
667 + --run="!3-,5" <<-\EOF &&
668 for i in 1 2 3 4 5 6
669 do
670 - test_expect_success \"passing test #\$i\" 'true'
670 + test_expect_success "passing test #$i" "true"
671 done
672 test_done
673 EOF
674 - check_sub_test_lib_test run-neg-inc <<-\\EOF
674 + check_sub_test_lib_test run-neg-inc <<-\EOF
675 > ok 1 - passing test #1
676 > ok 2 - passing test #2
677 > ok 3 # skip passing test #3 (--run)
@@ -681,19 +681,19 @@ test_expect_success '--run exclude and include' "
681 > # passed all 6 test(s)
682 > 1..6
683 EOF
684 -"
684 +'
685
686 -test_expect_success '--run empty selectors' "
686 +test_expect_success '--run empty selectors' '
687 run_sub_test_lib_test run-empty-sel \
688 - '--run empty selectors' \
689 - --run='1,,3,,,5' <<-\\EOF &&
688 + "--run empty selectors" \
689 + --run="1,,3,,,5" <<-\EOF &&
690 for i in 1 2 3 4 5 6
691 do
692 - test_expect_success \"passing test #\$i\" 'true'
692 + test_expect_success "passing test #$i" "true"
693 done
694 test_done
695 EOF
696 - check_sub_test_lib_test run-empty-sel <<-\\EOF
696 + check_sub_test_lib_test run-empty-sel <<-\EOF
697 > ok 1 - passing test #1
698 > ok 2 # skip passing test #2 (--run)
699 > ok 3 - passing test #3
@@ -703,20 +703,20 @@ test_expect_success '--run empty selectors' "
703 > # passed all 6 test(s)
704 > 1..6
705 EOF
706 -"
706 +'
707
708 -test_expect_success '--run substring selector' "
708 +test_expect_success '--run substring selector' '
709 run_sub_test_lib_test run-substring-selector \
710 - '--run empty selectors' \
711 - --run='relevant' <<-\\EOF &&
712 - test_expect_success \"relevant test\" 'true'
710 + "--run empty selectors" \
711 + --run="relevant" <<-\EOF &&
712 + test_expect_success "relevant test" "true"
713 for i in 1 2 3 4 5 6
714 do
715 - test_expect_success \"other test #\$i\" 'true'
715 + test_expect_success "other test #$i" "true"
716 done
717 test_done
718 EOF
719 - check_sub_test_lib_test run-substring-selector <<-\\EOF
719 + check_sub_test_lib_test run-substring-selector <<-\EOF
720 > ok 1 - relevant test
721 > ok 2 # skip other test #1 (--run)
722 > ok 3 # skip other test #2 (--run)
@@ -727,37 +727,37 @@ test_expect_success '--run substring selector' "
727 > # passed all 7 test(s)
728 > 1..7
729 EOF
730 -"
730 +'
731
732 -test_expect_success '--run keyword selection' "
732 +test_expect_success '--run keyword selection' '
733 run_sub_test_lib_test_err run-inv-range-start \
734 - '--run invalid range start' \
735 - --run='a-5' <<-\\EOF &&
736 - test_expect_success \"passing test #1\" 'true'
734 + "--run invalid range start" \
735 + --run="a-5" <<-\EOF &&
736 + test_expect_success "passing test #1" "true"
737 test_done
738 EOF
739 check_sub_test_lib_test_err run-inv-range-start \
740 - <<-\\EOF_OUT 3<<-\\EOF_ERR
740 + <<-\EOF_OUT 3<<-EOF_ERR
741 > FATAL: Unexpected exit with code 1
742 EOF_OUT
743 - > error: --run: invalid non-numeric in range start: 'a-5'
743 + > error: --run: invalid non-numeric in range start: ${SQ}a-5${SQ}
744 EOF_ERR
745 -"
745 +'
746
747 -test_expect_success '--run invalid range end' "
747 +test_expect_success '--run invalid range end' '
748 run_sub_test_lib_test_err run-inv-range-end \
749 - '--run invalid range end' \
750 - --run='1-z' <<-\\EOF &&
751 - test_expect_success \"passing test #1\" 'true'
749 + "--run invalid range end" \
750 + --run="1-z" <<-\EOF &&
751 + test_expect_success "passing test #1" "true"
752 test_done
753 EOF
754 check_sub_test_lib_test_err run-inv-range-end \
755 - <<-\\EOF_OUT 3<<-\\EOF_ERR
755 + <<-\EOF_OUT 3<<-EOF_ERR
756 > FATAL: Unexpected exit with code 1
757 EOF_OUT
758 - > error: --run: invalid non-numeric in range end: '1-z'
758 + > error: --run: invalid non-numeric in range end: ${SQ}1-z${SQ}
759 EOF_ERR
760 -"
760 +'
761
762 test_expect_success 'tests respect prerequisites' '
763 run_sub_test_lib_test prereqs "tests respect prereqs" <<-\EOF &&
@@ -839,18 +839,18 @@ test_expect_success 'nested lazy prerequisites' '
839 EOF
840 '
841
842 -test_expect_success 'lazy prereqs do not turn off tracing' "
842 +test_expect_success 'lazy prereqs do not turn off tracing' '
843 run_sub_test_lib_test lazy-prereq-and-tracing \
844 - 'lazy prereqs and -x' -v -x <<-\\EOF &&
844 + "lazy prereqs and -x" -v -x <<-\EOF &&
845 test_lazy_prereq LAZY true
846
847 - test_expect_success lazy 'test_have_prereq LAZY && echo trace'
847 + test_expect_success lazy "test_have_prereq LAZY && echo trace"
848
849 test_done
850 EOF
851
852 - grep 'echo trace' lazy-prereq-and-tracing/err
853 -"
852 + grep "echo trace" lazy-prereq-and-tracing/err
853 +'
854
855 test_expect_success 'tests clean up after themselves' '
856 run_sub_test_lib_test cleanup "test with cleanup" <<-\EOF &&
@@ -872,20 +872,20 @@ test_expect_success 'tests clean up after themselves' '
872 EOF
873 '
874
875 -test_expect_success 'tests clean up even on failures' "
875 +test_expect_success 'tests clean up even on failures' '
876 run_sub_test_lib_test_err \
877 - failing-cleanup 'Failing tests with cleanup commands' <<-\\EOF &&
878 - test_expect_success 'tests clean up even after a failure' '
877 + failing-cleanup "Failing tests with cleanup commands" <<-\EOF &&
878 + test_expect_success "tests clean up even after a failure" "
879 touch clean-after-failure &&
880 test_when_finished rm clean-after-failure &&
881 (exit 1)
882 - '
883 - test_expect_success 'failure to clean up causes the test to fail' '
882 + "
883 + test_expect_success "failure to clean up causes the test to fail" "
884 test_when_finished \"(exit 2)\"
885 - '
885 + "
886 test_done
887 EOF
888 - check_sub_test_lib_test failing-cleanup <<-\\EOF
888 + check_sub_test_lib_test failing-cleanup <<-\EOF
889 > not ok 1 - tests clean up even after a failure
890 > # Z
891 > # touch clean-after-failure &&
@@ -894,30 +894,30 @@ test_expect_success 'tests clean up even on failures' "
894 > # Z
895 > not ok 2 - failure to clean up causes the test to fail
896 > # Z
897 - > # test_when_finished \"(exit 2)\"
897 + > # test_when_finished "(exit 2)"
898 > # Z
899 > # failed 2 among 2 test(s)
900 > 1..2
901 EOF
902 -"
902 +'
903
904 -test_expect_success 'test_atexit is run' "
904 +test_expect_success 'test_atexit is run' '
905 run_sub_test_lib_test_err \
906 - atexit-cleanup 'Run atexit commands' -i <<-\\EOF &&
907 - test_expect_success 'tests clean up even after a failure' '
906 + atexit-cleanup "Run atexit commands" -i <<-\EOF &&
907 + test_expect_success "tests clean up even after a failure" "
908 > ../../clean-atexit &&
909 test_atexit rm ../../clean-atexit &&
910 > ../../also-clean-atexit &&
911 test_atexit rm ../../also-clean-atexit &&
912 > ../../dont-clean-atexit &&
913 (exit 1)
914 - '
914 + "
915 test_done
916 EOF
917 test_path_is_file dont-clean-atexit &&
918 test_path_is_missing clean-atexit &&
919 test_path_is_missing also-clean-atexit
920 -"
920 +'
921
922 test_expect_success 'test_oid provides sane info by default' '
923 test_oid zero >actual &&