]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t1006: assert error output of cat-file
authorAndrei Rybak <rybak.a.v@gmail.com>
Sat, 18 Mar 2023 15:46:41 +0000 (16:46 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Mar 2023 16:11:41 +0000 (09:11 -0700)
Test "cat-file $arg1 $arg2 error on missing full OID" in
t1006-cat-file.sh compares files "expect.err" and "err.actual" to assert
the expected error output of "git cat-file".  A similar test in the same
file named "cat-file $arg1 $arg2 error on missing short OID" also
creates these two files, but doesn't use them in assertions.

Assert error output of "git cat-file" in test "cat-file $arg1 $arg2
error on missing short OID" of t1006-cat-file.sh to improve test
coverage.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1006-cat-file.sh

index 2d875b17d8a94a45b9789e3466139adbd6b4c680..8eac74b59c2faa9c6e9f2396214264861c8416c1 100755 (executable)
@@ -603,7 +603,8 @@ do
                        fatal: Not a valid object name $(test_oid deadbeef_short)
                        EOF
                        test_must_fail git cat-file $arg1 $arg2 $(test_oid deadbeef_short) >out 2>err.actual &&
-                       test_must_be_empty out
+                       test_must_be_empty out &&
+                       test_cmp expect.err err.actual
                '
 
                test_expect_success "cat-file $arg1 $arg2 error on missing full OID" '