From 22063c8c083d2d8130efb76482e45fa1976a595a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 8 Nov 2016 19:57:41 -0600 Subject: tests: use "returns_" rather than explicit comparison with "$?" * tests/chmod/no-x.sh: Likewise. * tests/cp/no-deref-link1.sh: Likewise. * tests/cp/no-deref-link2.sh: Likewise. * tests/cp/no-deref-link3.sh: Likewise. * tests/du/move-dir-while-traversing.sh: Likewise. * tests/ls/infloop.sh: Likewise. * tests/ls/stat-failed.sh: Likewise. * tests/ls/time-style-diag.sh: Likewise. * tests/misc/chroot-fail.sh: Likewise. * tests/misc/env-null.sh: Likewise. * tests/misc/env.sh: Likewise. * tests/misc/nice-fail.sh: Likewise. * tests/misc/printenv.sh: Likewise. * tests/misc/timeout.sh: Likewise. * tests/tail-2/follow-name.sh: Likewise. --- tests/cp/no-deref-link1.sh | 4 +--- tests/cp/no-deref-link2.sh | 4 +--- tests/cp/no-deref-link3.sh | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) (limited to 'tests/cp') diff --git a/tests/cp/no-deref-link1.sh b/tests/cp/no-deref-link1.sh index b1754b728..4b7c057cd 100755 --- a/tests/cp/no-deref-link1.sh +++ b/tests/cp/no-deref-link1.sh @@ -29,10 +29,8 @@ cd .. # It should fail with a message something like this: # ./cp: 'a/foo' and 'b/foo' are the same file -cp -d a/foo b 2>/dev/null - # Fail this test if the exit status is not 1 -test $? = 1 || fail=1 +returns_ 1 cp -d a/foo b 2>/dev/null || fail=1 test "$(cat a/foo)" = $msg || fail=1 diff --git a/tests/cp/no-deref-link2.sh b/tests/cp/no-deref-link2.sh index 25a8848fa..7f0ca4816 100755 --- a/tests/cp/no-deref-link2.sh +++ b/tests/cp/no-deref-link2.sh @@ -29,10 +29,8 @@ cd .. # It should fail with a message something like this: # cp: 'a' and 'b/foo' are the same file -cp -d a b 2>/dev/null - # Fail this test if the exit status is not 1 -test $? = 1 || fail=1 +returns_ 1 cp -d a b 2>/dev/null || fail=1 test "$(cat a)" = $msg || fail=1 diff --git a/tests/cp/no-deref-link3.sh b/tests/cp/no-deref-link3.sh index 897eb6b8d..137a50181 100755 --- a/tests/cp/no-deref-link3.sh +++ b/tests/cp/no-deref-link3.sh @@ -26,10 +26,8 @@ ln -s a b # It should fail with a message something like this: # cp: 'a' and 'b' are the same file -cp -d a b 2>/dev/null - # Fail this test if the exit status is not 1 -test $? = 1 || fail=1 +returns_ 1 cp -d a b 2>/dev/null || fail=1 test "$(cat a)" = $msg || fail=1 -- cgit v1.2.3-70-g09d2