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" 9echo "hello" > file 10tar -cJf file.xz file 11# Get system xzcat 12xzcatExe=`which xzcat` 13$xzcatExe file.xz > xzcatOut 14testing "- 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" 17echo "hello" > file1 18echo "hi" > file2 19echo "Hi, Good morning !! I am a xzcat tester" > file3 20tar -cJf file1.xz file1 21tar -cJf file2.xz file2 22tar -cJf file3.xz file3 23# Get system xzcat 24xzcatExe=`which xzcat` 25$xzcatExe file1.xz file2.xz file3.xz > xzcatOut 26testing "- 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" "" "" 27