t5318-commit-graph: use 'test_expect_code'
authorSZEDER Gábor <szeder.dev@gmail.com>
Mon, 5 Aug 2019 08:02:38 +0000 (10:02 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 5 Aug 2019 21:30:59 +0000 (14:30 -0700)
In 't5318-commit-graph.sh' the test 'close with correct error on bad
input' manually verifies the exit code of a 'git commit-graph write'
command.

Use 'test_expect_code' instead.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5318-commit-graph.sh
index 22cb9d66430410f726e821e906fa79587f43c3e8..4391007f4c1c60fe7d66249a8190c6ea0f317eb8 100755 (executable)
@@ -26,8 +26,7 @@ test_expect_success 'write graph with no packs' '
 test_expect_success 'close with correct error on bad input' '
        cd "$TRASH_DIRECTORY/full" &&
        echo doesnotexist >in &&
-       { git commit-graph write --stdin-packs <in 2>stderr; ret=$?; } &&
-       test "$ret" = 1 &&
+       test_expect_code 1 git commit-graph write --stdin-packs <in 2>stderr &&
        test_i18ngrep "error adding pack" stderr
 '