aboutsummaryrefslogtreecommitdiff
path: root/scripts/test
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2008-05-04 15:35:04 -0500
committerRob Landley <rob@landley.net>2008-05-04 15:35:04 -0500
commitac9c592fc88d0a5d6a971e7407b99b18fb425ad6 (patch)
tree6812e21c9ced3aa6d5a0eb89202a151a64aabb89 /scripts/test
parent3fc4e0fd7b4f286fa176b779b2cec243d61ade50 (diff)
downloadtoybox-ac9c592fc88d0a5d6a971e7407b99b18fb425ad6.tar.gz
Very simple cat tests, with more test ideas commented out.
Diffstat (limited to 'scripts/test')
-rwxr-xr-xscripts/test/cat.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/test/cat.test b/scripts/test/cat.test
new file mode 100755
index 00000000..583c4e82
--- /dev/null
+++ b/scripts/test/cat.test
@@ -0,0 +1,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"