aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/cmp.test6
-rwxr-xr-xtests/env.test2
-rwxr-xr-xtests/sort.test1
3 files changed, 7 insertions, 2 deletions
diff --git a/tests/cmp.test b/tests/cmp.test
index 3b2dd1b2..62d4b89d 100755
--- a/tests/cmp.test
+++ b/tests/cmp.test
@@ -2,8 +2,10 @@
[ -f testing.sh ] && . testing.sh
-testing "not enough arguments [fail]" "cmp input 2>/dev/null || echo yes" "yes\n" "foo" ""
-testing "missing file1 [fail]" "cmp file1 input 2>/dev/null || echo yes" "yes\n" "foo" ""
+# TODO: coreutils cmp uses stdin if only one file is given
+SKIP_HOST=1 testing "not enough arguments [fail]" 'cmp input 2>/dev/null || echo $?' "2\n" "foo" ""
+
+testing "missing file1 [fail]" 'cmp file1 input 2>/dev/null || echo $?' "2\n" "foo" ""
#mkdir dir
#testing "directory [fail]" "cmp dir dir 2>/dev/null || echo yes" \
diff --git a/tests/env.test b/tests/env.test
index e92164c5..286fb36c 100755
--- a/tests/env.test
+++ b/tests/env.test
@@ -16,3 +16,5 @@ testcmd "-i =" "-i one=two three=four env | sort" \
"one=two\nthree=four\n" "" ""
testcmd "-0" "-i five=six seven=eight env -0 | sort -z" "five=six\0seven=eight\0" "" ""
unset WALRUS BANANA LETTERS FILTER
+
+testcmd "early fail" '--oops 2> /dev/null ; echo $?' "125\n" "" ""
diff --git a/tests/sort.test b/tests/sort.test
index a40d1b0f..dd2b8263 100755
--- a/tests/sort.test
+++ b/tests/sort.test
@@ -7,6 +7,7 @@
# The basic tests. These should work even with the small config.
+testing "unknown argument" 'sort --oops 2>/dev/null ; echo $?' "2\n" "" ""
testing "sort" "sort input" "a\nb\nc\n" "c\na\nb\n" ""
testing "#2" "sort input" "010\n1\n3\n" "3\n1\n010\n" ""
testing "stdin" "sort" "a\nb\nc\n" "" "b\na\nc\n"