Mercurial > hg > toybox
changeset 285:7bdca139b03f
Very simple cat tests, with more test ideas commented out.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 04 May 2008 15:35:04 -0500 |
parents | 603275a05524 |
children | 7126df2ae342 |
files | scripts/test/cat.test |
diffstat | 1 files changed, 21 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/test/cat.test Sun May 04 15:35:04 2008 -0500 @@ -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"