xzcat.test 993 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. # Copyright 2014 Divya Kothari <divya.s.kothari@gmail.com>
  3. # Copyright 2014 Naha Maggu <maggu.neha@gmail.com>
  4. [ -f testing.sh ] && . testing.sh
  5. #testing "name" "command" "result" "infile" "stdin"
  6. echo "hello" > file
  7. tar -cJf file.xz file
  8. # Get system xzcat
  9. xzcatExe=`which xzcat`
  10. $xzcatExe file.xz > xzcatOut
  11. testing "- decompresses a single file" "xzcat file.xz > Tempfile && echo "yes"; diff Tempfile xzcatOut && echo "yes"; rm -rf file* xzcatOut Tempfile" "yes\nyes\n" "" ""
  12. #testing "name" "command" "result" "infile" "stdin"
  13. echo "hello" > file1
  14. echo "hi" > file2
  15. echo "Hi, Good morning !! I am a xzcat tester" > file3
  16. tar -cJf file1.xz file1
  17. tar -cJf file2.xz file2
  18. tar -cJf file3.xz file3
  19. # Get system xzcat
  20. xzcatExe=`which xzcat`
  21. $xzcatExe file1.xz file2.xz file3.xz > xzcatOut
  22. testing "- decompresses multiple files" "xzcat file1.xz file2.xz file3.xz > Tempfile && echo "yes" ; diff Tempfile xzcatOut && echo "yes"; rm -rf file* xzcatOut Tempfile " "yes\nyes\n" "" ""