mirror of
https://codeberg.org/landley/toybox.git
synced 2026-01-26 14:13:25 +00:00
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:
parent
acf34f524d
commit
e5e286bf3c
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user