aboutsummaryrefslogtreecommitdiff
path: root/scripts/test/cat.test
blob: 583c4e824e57feb01106c18706e7b89eaf429e2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

[ -f testing.sh ] && . testing.sh

#testing "name" "command" "result" "infile" "stdin"

testing "cat" "cat && echo yes" "oneyes\n" "" "one"
testing "cat file1" \
	"cat /bin/cat > file1 && diff -u /bin/cat file1 && echo yes" \
	"yes\n" "" ""
#testing "cat file1 file2" "cat /bin/cat file1 > file2 && diff -u -

testing "cat - file1" \
	"cat - file1 | diff -a -U 0 - file1 | tail -n 1" \
	"-hello\n" "" "hello\n"

rm file1
#testing "cat file1 file2" "cat $0"
#testing "cat - file"
#testing "cat > /dev/full"
#testing "cat file1 notfound file2"