summaryrefslogtreecommitdiff
path: root/tests/cp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cp')
-rwxr-xr-xtests/cp/no-deref-link1.sh4
-rwxr-xr-xtests/cp/no-deref-link2.sh4
-rwxr-xr-xtests/cp/no-deref-link3.sh4
3 files changed, 3 insertions, 9 deletions
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