OSDN Git Service

Add grep -B -C
[android-x86/external-toybox.git] / tests / bzcat.test
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.tar.bz2 file
11 # Get system bzcat
12 bzcatExe=`which bzcat`
13 $bzcatExe file.tar.bz2 > bzcatOut
14 testing "bzcat - decompresses a single file" "bzcat file.tar.bz2 > Tempfile && echo "yes"; diff Tempfile bzcatOut && echo "yes"; rm -rf file* bzcatOut 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 bzcat tester" > file3
20 tar -cjf file1.tar.bz2 file1
21 tar -cjf file2.tar.bz2 file2
22 tar -cjf file3.tar.bz2 file3
23 # Get system bzcat
24 bzcatExe=`which bzcat`
25 $bzcatExe file1.tar.bz2 file2.tar.bz2 file3.tar.bz2 > bzcatOut
26 testing "bzcat - decompresses multiple files" "bzcat file1.tar.bz2 file2.tar.bz2 file3.tar.bz2 > Tempfile && echo "yes" ; diff Tempfile bzcatOut && echo "yes"; rm -rf file* bzcatOut Tempfile " "yes\nyes\n" "" ""