diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2018-07-02 02:23:54 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-07-16 23:38:47 +0200 |
commit | 794165cb17c1f19c21ac36c2c362f0e4069de792 (patch) | |
tree | 3d25b0d59a32974989edc792bd22bb5447c660e1 /t/t9814-git-p4-rename.sh | |
parent | t9001: fix broken "invoke hook" test (diff) | |
download | git-794165cb17c1f19c21ac36c2c362f0e4069de792.tar.xz git-794165cb17c1f19c21ac36c2c362f0e4069de792.zip |
t9814: simplify convoluted check that command correctly errors out
This test uses a convoluted method to verify that "p4 help" errors
out when asked for help about an unknown command. In doing so, it
intentionally breaks the &&-chain. Simplify by employing the typical
"! command" idiom and a normal &&-chain instead.
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9814-git-p4-rename.sh')
-rwxr-xr-x | t/t9814-git-p4-rename.sh | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/t/t9814-git-p4-rename.sh b/t/t9814-git-p4-rename.sh index e7e0268e98..60baa06e27 100755 --- a/t/t9814-git-p4-rename.sh +++ b/t/t9814-git-p4-rename.sh @@ -9,23 +9,11 @@ test_expect_success 'start p4d' ' ' # We rely on this behavior to detect for p4 move availability. -test_expect_success 'p4 help unknown returns 1' ' +test_expect_success '"p4 help unknown" errors out' ' ( cd "$cli" && - ( - p4 help client >errs 2>&1 - echo $? >retval - ) - echo 0 >expected && - test_cmp expected retval && - rm retval && - ( - p4 help nosuchcommand >errs 2>&1 - echo $? >retval - ) - echo 1 >expected && - test_cmp expected retval && - rm retval + p4 help client && + ! p4 help nosuchcommand ) ' |