From b2ace093819f948bd29f576254f343ef88787398 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 22 Nov 2019 12:03:28 -0800 Subject: 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. --- tests/cat.test | 7 +++---- 1 file 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" -- cgit v1.2.3