Lines Matching +full:- +full:f1
3 [ -f testing.sh ] && . testing.sh
10 echo -n "foo " > f1
12 testing "with input files" "gzip f1 f2 &&
13 test -f f1.gz && test -f f2.gz &&
14 ! test -f f1 && ! test -f f2 &&
15 zcat f1.gz f2.gz" "foo bar\n" "" ""
16 rm -f f1 f2 f1.gz f2.gz
20 test -f f.gz && zcat f.gz" "hello world\n" "" ""
21 rm -f f.gz
23 # -c Output to stdout
24 echo -n "foo " > f1
26 testing "with input files and -c" "gzip -c f1 f2 > out.gz &&
27 ! test -f f1.gz && ! test -f f2.gz &&
28 test -f f1 && test -f f2 &&
30 rm -f f1 f2 out.gz
32 # -d Decompress (act as gunzip)
34 testing "-d (act as gunzip)" "gzip -d f.gz &&
35 test -f f && ! test -f f.gz && cat f" "hello world\n" "" ""
36 rm -f f.gz f
39 testing "-dc (act as zcat)" "gzip -dc f.gz &&
40 ! test -f f && test -f f.gz" "hello world\n" "" ""
41 rm -f f.gz f
43 # -f Force: allow overwrite of output file
44 echo "hello world" > f1
45 echo "precious data" > f1.gz
46 testing "no overwrite without -f" \
47 "gzip f1 2>/dev/null || echo refused && cat f1 f1.gz" \
49 testing "overwrite with -f" \
50 "gzip -f f1 && echo allowed && ! test -f f1 && zcat f1.gz" \
52 rm -f f1 f1.gz
54 # -k Keep input files (don't remove)
55 echo "hello world" > f1
56 testing "-k" "gzip -k f1 && cat f1 && zcat f1.gz" \
58 rm -f f1 f1.gz
60 # Test that -9 compresses better than -1.
62 gzip -c1 x > x1.gz
63 gzip -c9 x > x9.gz
64 testing "-1 vs -9" \
65 "test $(stat -c '%s' x1.gz) -gt $(stat -c '%s' x9.gz) && echo okay" \
67 rm -f x x1.gz x9.gz
71 echo "hello world" > f1
72 chmod 0411 f1
73 touch -a -t 197801020304 f1
74 touch -m -t 198704030201 f1
76 "gzip -k f1 && TZ=UTC stat -c '%a %Y' f1 && stat -c '%a %X %Y' f1.gz" \
78 rm -f f1 f1.gz
80 testing "reject non-gzip" "gzip -dc $FILES/blkid/msdos.bz2 2>/dev/null ||