t0000: quote TAP snippets in test code

t0000 contains two snippets of actual test output.  This causes
problems when passing -v to the test[*]: the test infrastructure
echoes the tests before running them, and the TAP parser then sees
this test output and concludes that two tests failed and that the TAP
output was badly formatted.

Guard against this by quoting the output in the source.

[*] either by running 'make smoke' with GIT_TEST_OPTS=-v, or with
prove ./t0000-basic.sh :: -v

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Thomas Rast 2011-01-13 12:30:23 +01:00 committed by Junio C Hamano
parent d2f15e29a6
commit 9cf3f14766

View File

@ -80,11 +80,11 @@ EOF
chmod +x passing-todo.sh && chmod +x passing-todo.sh &&
./passing-todo.sh >out 2>err && ./passing-todo.sh >out 2>err &&
! test -s err && ! test -s err &&
cat >expect <<EOF && sed -e 's/^> //' >expect <<EOF &&
ok 1 - pretend we have fixed a known breakage # TODO known breakage > ok 1 - pretend we have fixed a known breakage # TODO known breakage
# fixed 1 known breakage(s) > # fixed 1 known breakage(s)
# passed all 1 test(s) > # passed all 1 test(s)
1..1 > 1..1
EOF EOF
test_cmp expect out) test_cmp expect out)
" "
@ -164,19 +164,19 @@ EOF
test_must_fail ./failing-cleanup.sh >out 2>err && test_must_fail ./failing-cleanup.sh >out 2>err &&
! test -s err && ! test -s err &&
! test -f \"trash directory.failing-cleanup/clean-after-failure\" && ! test -f \"trash directory.failing-cleanup/clean-after-failure\" &&
sed -e 's/Z$//' >expect <<\EOF && sed -e 's/Z$//' -e 's/^> //' >expect <<\EOF &&
not ok - 1 tests clean up even after a failure > not ok - 1 tests clean up even after a failure
# Z > # Z
# touch clean-after-failure && > # touch clean-after-failure &&
# test_when_finished rm clean-after-failure && > # test_when_finished rm clean-after-failure &&
# (exit 1) > # (exit 1)
# Z > # Z
not ok - 2 failure to clean up causes the test to fail > not ok - 2 failure to clean up causes the test to fail
# Z > # Z
# test_when_finished \"(exit 2)\" > # test_when_finished \"(exit 2)\"
# Z > # Z
# failed 2 among 2 test(s) > # failed 2 among 2 test(s)
1..2 > 1..2
EOF EOF
test_cmp expect out) test_cmp expect out)
" "