aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-09-05 00:32:38 -0500
committerRob Landley <rob@landley.net>2016-09-05 00:32:38 -0500
commit19394faadb511c6f5ed015d63f6e5ba32c4fc4ca (patch)
tree104419e3a1939502022f7e473fdfc2caa71c73f2 /tests
parent8361fbd8ea9c6f29602982d31f67351f42f736b0 (diff)
downloadtoybox-19394faadb511c6f5ed015d63f6e5ba32c4fc4ca.tar.gz
Fluff up cmp tests.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/cmp.test6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/cmp.test b/tests/cmp.test
index c3e8f5be..3b2dd1b2 100755
--- a/tests/cmp.test
+++ b/tests/cmp.test
@@ -22,12 +22,14 @@ testing "EOF, return code" "cmp input input2 2>/dev/null || echo yes" "yes\n" "a
testing "diff, stdout" "cmp input input2" "input input2 differ: char 4, line 2\n" "ab\nx\nx" ""
testing "diff, return code" "cmp input input2 > /dev/null || echo yes" "yes\n" "ab\nx\nx" ""
-testing "-s EOF, return code" "cmp -s input input2 || echo yes" "yes\n" "ab\nc\nx" ""
-testing "-s diff, return code" "cmp -s input input2 || echo yes" "yes\n" "ab\nx\nx" ""
+testing "-s EOF, return code" "cmp -s input input2 2>&1 || echo yes" "yes\n" "ab\nc\nx" ""
+testing "-s diff, return code" "cmp -s input input2 2>&1 || echo yes" "yes\n" "ab\nx\nx" ""
testing "-l EOF, stderr" "cmp -l input input2 2>&1" "cmp: EOF on input2\n" "ab\nc\nx" ""
testing "-l diff and EOF, stdout and stderr" "cmp -l input input2 2>&1 | sort" "4 170 143\ncmp: EOF on input2\n" "ab\nx\nx" ""
+testing "-s not exist" "cmp -s input doesnotexist 2>&1 || echo yes" "yes\n" "" ""
+
rm input2
testing "stdin and file" "cmp input -" "input - differ: char 4, line 2\n" "ab\nc\n" "ab\nx\n"