| #!/bin/bash | |
| [ -f testing.sh ] && . testing.sh | |
| #testing "name" "command" "result" "infile" "stdin" | |
| echo -n "foo " | gzip > f1.gz | |
| echo "bar" | gzip > f2.gz | |
| # zcat is basically just `gzip -dc`... | |
| testing "files" "zcat f1.gz f2.gz && test -f f1.gz && test -f f2.gz" \ | |
| "foo bar\n" "" "" | |
| # zcat -c is allowed, but the -c changes nothing. | |
| testing "-c" "zcat -c f1.gz f2.gz && test -f f1.gz && test -f f2.gz" \ | |
| "foo bar\n" "" "" | |
| # TODO: how to test "zcat -f"? | |
| rm -f f1 f2 f1.gz f2.gz |