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