aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-11-22 12:03:28 -0800
committerRob Landley <rob@landley.net>2019-11-23 09:31:43 -0600
commitb2ace093819f948bd29f576254f343ef88787398 (patch)
tree45924bd69236a410cecaa40d8b177c59a9040359 /tests
parent0bee51bc51f08c94ff5714249662c10c8c859b87 (diff)
downloadtoybox-b2ace093819f948bd29f576254f343ef88787398.tar.gz
cat.test: fix tests for Mac.
/proc/self/exe doesn't exist, but $C already gives us the path to the binary. /dev/full doesn't have any equivalent afaik, so skip that test if /dev/full is missing.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/cat.test7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/cat.test b/tests/cat.test
index 8845070e..ef4f4f04 100755
--- a/tests/cat.test
+++ b/tests/cat.test
@@ -16,15 +16,14 @@ testing "file1 notfound file2" \
"cat file1 notfound file2 2>stderr && echo ok ; cat stderr; rm stderr" \
"one\ntwo\ncat: notfound: No such file or directory\n" "" ""
-FILE="$(readlink -f /proc/self/exe)"
-testing "file1" \
- 'cat "$FILE" > file1 && cmp "$FILE" file1 && echo yes' \
- "yes\n" "" ""
+testing "binary" \
+ 'cat "$C" > file1 && cmp "$C" file1 && echo yes' "yes\n" "" ""
testing "- file1" \
"cat - file1 | diff -a -U 0 - file1 | tail -n 1" \
"-hello\n" "" "hello\n"
+[ -e /dev/full ] || SKIPNEXT=1
testing "> /dev/full" \
"cat - > /dev/full 2>stderr && echo ok; cat stderr; rm stderr" \
"cat: xwrite: No space left on device\n" "" "zero\n"