3 [ -f testing.sh ] && . testing.sh
5 #testing "name" "command" "result" "infile" "stdin"
9 testing "cat" "cat && echo yes" "oneyes\n" "" "one"
10 testing "cat -" "cat - && echo yes" "oneyes\n" "" "one"
11 testing "cat file1 file2" "cat file1 file2" "one\ntwo\n" "" ""
12 testing "cat - file" "cat - file1" "zero\none\n" "" "zero\n"
13 testing "cat file -" "cat file1 -" "one\nzero\n" "" "zero\n"
15 testing "cat file1 notfound file2" \
16 "cat file1 notfound file2 2>stderr && echo ok ; cat stderr; rm stderr" \
17 "one\ntwo\ncat: notfound: No such file or directory\n" "" ""
20 "cat /proc/self/exe > file1 && cmp /proc/self/exe file1 && echo yes" \
23 testing "cat - file1" \
24 "cat - file1 | diff -a -U 0 - file1 | tail -n 1" \
25 "-hello\n" "" "hello\n"
27 testing "cat > /dev/full" \
28 "cat - > /dev/full 2>stderr && echo ok; cat stderr; rm stderr" \
29 "cat: xwrite: No space left on device\n" "" "zero\n"