OSDN Git Service

Fix hang in losetup test.
[android-x86/external-toybox.git] / tests / zcat.test
1 #!/bin/bash
2
3 [ -f testing.sh ] && . testing.sh
4
5 #testing "name" "command" "result" "infile" "stdin"
6
7 echo -n "foo " | gzip > f1.gz
8 echo "bar" | gzip > f2.gz
9
10 # zcat is basically just `gzip -dc`...
11 testing "files" "zcat f1.gz f2.gz && test -f f1.gz && test -f f2.gz" \
12     "foo bar\n" "" ""
13
14 # zcat -c is allowed, but the -c changes nothing.
15 testing "-c" "zcat -c f1.gz f2.gz && test -f f1.gz && test -f f2.gz" \
16     "foo bar\n" "" ""
17
18 # TODO: how to test "zcat -f"?
19
20 rm -f f1 f2 f1.gz f2.gz