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.
This commit is contained in:
Rob Landley 2016-01-31 15:30:48 -06:00
parent acf34f524d
commit e5e286bf3c

View File

@ -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
rm file1 file2