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>
This commit is contained in:
Eric Sunshine 2018-07-01 20:23:54 -04:00 коммит произвёл Junio C Hamano
Родитель be8c48d4c4
Коммит 794165cb17
1 изменённых файлов: 3 добавлений и 15 удалений

Просмотреть файл

@ -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
)
'