From: Thomas Rast Date: Thu, 13 Jan 2011 11:30:23 +0000 (+0100) Subject: t0000: quote TAP snippets in test code X-Git-Tag: v1.7.4-rc2~10 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9cf3f14766b025bfc90fbac856d7a6493ef36c8b;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index 2f7002a5e..8deec75c3 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -80,11 +80,11 @@ EOF chmod +x passing-todo.sh && ./passing-todo.sh >out 2>err && ! test -s err && -cat >expect < //' >expect < ok 1 - pretend we have fixed a known breakage # TODO known breakage +> # fixed 1 known breakage(s) +> # passed all 1 test(s) +> 1..1 EOF test_cmp expect out) " @@ -164,19 +164,19 @@ EOF test_must_fail ./failing-cleanup.sh >out 2>err && ! test -s err && ! test -f \"trash directory.failing-cleanup/clean-after-failure\" && -sed -e 's/Z$//' >expect <<\EOF && -not ok - 1 tests clean up even after a failure -# Z -# touch clean-after-failure && -# test_when_finished rm clean-after-failure && -# (exit 1) -# Z -not ok - 2 failure to clean up causes the test to fail -# Z -# test_when_finished \"(exit 2)\" -# Z -# failed 2 among 2 test(s) -1..2 +sed -e 's/Z$//' -e 's/^> //' >expect <<\EOF && +> not ok - 1 tests clean up even after a failure +> # Z +> # touch clean-after-failure && +> # test_when_finished rm clean-after-failure && +> # (exit 1) +> # Z +> not ok - 2 failure to clean up causes the test to fail +> # Z +> # test_when_finished \"(exit 2)\" +> # Z +> # failed 2 among 2 test(s) +> 1..2 EOF test_cmp expect out) "