Skip to content

Commit 52d0c32

Browse files
pks-tgitster
authored andcommitted
t1006: fix broken TAP format
When running t1006 via Meson we receive an error about invalid TAP format: $ meson test t1006-cat-file 1/1 t1006-cat-file OK 3.86s 420 subtests passed stdout: 147: UNKNOWN: c308ae01840d8e620ad554ee5d77fe114dc2d912:path with spaces stdout: 159: UNKNOWN: 3625298bf5e7c464a7d0e38ea80c2a5b5904d9a3e5b2b025b67f360e09b68dc7:path with spaces ERROR: Unknown TAP output lines for a supported TAP version. This is probably a bug in the test; if they are not TAP syntax, prefix them with a # Ok: 1 Fail: 0 While Meson copes with it alright, it's still annoying to see these errors on every test run. The root cause of the broken format is a call to grep(1) that gets executed outside of a test case, which has been added recently via 9fd3803 (t1006: update 'run_tests' to test generic object specifiers, 2025-06-02). This call is done to determine whether a subsequent test case is expected to succeed or fail, so it makes sense to have it execute outside of a test case. But whenever we do that, we must be extra careful to not generate any output that breaks the TAP format. Fix the issue by adding '-q' to the command so that it doesn't print any matching lines. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 038143d commit 52d0c32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t1006-cat-file.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ $content"
197197
# FIXME: %(rest) is incompatible with object names that include whitespace,
198198
# e.g. HEAD:path/to/a/file with spaces. Use the resolved OID as input to
199199
# test this instead of the raw object name.
200-
if echo "$object_name" | grep " "; then
200+
if echo "$object_name" | grep -q " "; then
201201
test_rest=test_expect_failure
202202
else
203203
test_rest=test_expect_success

0 commit comments

Comments
 (0)