From e5e286bf3cd8544ab161c508cbc810a104a7b186 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 31 Jan 2016 15:30:48 -0600 Subject: Fix broken test in cat.test. "cat /proc/self/exe && cmp /proc/self/exe" won't see the same file if cat and cmp aren't both in a toybox multiplexer binary, so snapshot and pick one. --- tests/cat.test | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/cat.test') diff --git a/tests/cat.test b/tests/cat.test index 3d5842ae..7be515dd 100755 --- a/tests/cat.test +++ b/tests/cat.test @@ -16,8 +16,9 @@ testing "cat 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 "cat file1" \ - "cat /proc/self/exe > file1 && cmp /proc/self/exe file1 && echo yes" \ + 'cat "$FILE" > file1 && cmp "$FILE" file1 && echo yes' \ "yes\n" "" "" testing "cat - file1" \ @@ -28,4 +29,4 @@ testing "cat > /dev/full" \ "cat - > /dev/full 2>stderr && echo ok; cat stderr; rm stderr" \ "cat: xwrite: No space left on device\n" "" "zero\n" -rm file1 file2 \ No newline at end of file +rm file1 file2 -- cgit v1.2.3