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>
Thomas Rast committed
Jan 13, 2011 at 12:30 UTC
9cf3f14766b025bfc90fbac856d7a6493ef36c8b
1 file changed
+18
-18
t/t0000-basic.sh
+18
-18
@@ -80,11 +80,11 @@ EOF
80
chmod +x passing-todo.sh &&
81
./passing-todo.sh >out 2>err &&
82
! test -s err &&
83
-cat >expect <<EOF &&
84
-ok 1 - pretend we have fixed a known breakage # TODO known breakage
85
-# fixed 1 known breakage(s)
86
-# passed all 1 test(s)
87
-1..1
83
+sed -e 's/^> //' >expect <<EOF &&
84
+> ok 1 - pretend we have fixed a known breakage # TODO known breakage
85
+> # fixed 1 known breakage(s)
86
+> # passed all 1 test(s)
87
+> 1..1
88
EOF
89
test_cmp expect out)
90
"
@@ -164,19 +164,19 @@ EOF
164
test_must_fail ./failing-cleanup.sh >out 2>err &&
165
! test -s err &&
166
! test -f \"trash directory.failing-cleanup/clean-after-failure\" &&
167
-sed -e 's/Z$//' >expect <<\EOF &&
168
-not ok - 1 tests clean up even after a failure
169
-# Z
170
-# touch clean-after-failure &&
171
-# test_when_finished rm clean-after-failure &&
172
-# (exit 1)
173
-# Z
174
-not ok - 2 failure to clean up causes the test to fail
175
-# Z
176
-# test_when_finished \"(exit 2)\"
177
-# Z
178
-# failed 2 among 2 test(s)
179
-1..2
167
+sed -e 's/Z$//' -e 's/^> //' >expect <<\EOF &&
168
+> not ok - 1 tests clean up even after a failure
169
+> # Z
170
+> # touch clean-after-failure &&
171
+> # test_when_finished rm clean-after-failure &&
172
+> # (exit 1)
173
+> # Z
174
+> not ok - 2 failure to clean up causes the test to fail
175
+> # Z
176
+> # test_when_finished \"(exit 2)\"
177
+> # Z
178
+> # failed 2 among 2 test(s)
179
+> 1..2
180
EOF
181
test_cmp expect out)
182
"