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>
Eric Sunshine committed
Jul 1, 2018 at 20:23 UTC
794165cb17c1f19c21ac36c2c362f0e4069de792
1 file changed
+3
-15
t/t9814-git-p4-rename.sh
+3
-15
@@ -9,23 +9,11 @@ test_expect_success 'start p4d' '
9
'
10
11
# We rely on this behavior to detect for p4 move availability.
12
-test_expect_success 'p4 help unknown returns 1' '
12
+test_expect_success '"p4 help unknown" errors out' '
13
(
14
cd "$cli" &&
15
- (
16
- p4 help client >errs 2>&1
17
- echo $? >retval
18
- )
19
- echo 0 >expected &&
20
- test_cmp expected retval &&
21
- rm retval &&
22
- (
23
- p4 help nosuchcommand >errs 2>&1
24
- echo $? >retval
25
- )
26
- echo 1 >expected &&
27
- test_cmp expected retval &&
28
- rm retval
15
+ p4 help client &&
16
+ ! p4 help nosuchcommand
17
)
18
'
19