zcat.test 491 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. [ -f testing.sh ] && . testing.sh
  3. #testing "name" "command" "result" "infile" "stdin"
  4. echo -n "foo " | gzip > f1.gz
  5. echo "bar" | gzip > f2.gz
  6. # zcat is basically just `gzip -dc`...
  7. testing "files" "zcat f1.gz f2.gz && test -f f1.gz && test -f f2.gz" \
  8. "foo bar\n" "" ""
  9. # zcat -c is allowed, but the -c changes nothing.
  10. testing "-c" "zcat -c f1.gz f2.gz && test -f f1.gz && test -f f2.gz" \
  11. "foo bar\n" "" ""
  12. # TODO: how to test "zcat -f"?
  13. rm -f f1 f2 f1.gz f2.gz