Lines Matching refs:file
31 # If the compressed version of a file would be larger than the
32 # original file, the original file is kept.
34 echo 'hello' > file
36 atf_check compress file
38 atf_check -o 'inline:hello\n' cat file
39 atf_check test ! -f file.Z
47 # file becomes larger than the original.
49 echo 'hello' > file
51 atf_check compress -f file
53 atf_check test ! -f file
56 od -Ax -tx1 file.Z
63 # Compressing and decompressing a file must preserve every byte.
65 atf_check -e 'ignore' dd if=/dev/urandom of=file bs=4k count=10
66 atf_check cp file original
68 atf_check compress -f file
69 atf_check uncompress file.Z
71 atf_check cmp file original
78 # To uncompress a file, it suffices to specify the basename of the
79 # file, the filename extension '.Z' is optional.
81 atf_check sh -c "echo 'hello' > file"
82 atf_check compress -f file
84 atf_check uncompress file
86 atf_check -o 'inline:hello\n' cat file
87 atf_check test ! -f file.Z
97 # target file and didn't clean it up.
101 -e 'inline:uncompress: file.Z: No such file or directory\n' \
102 uncompress -f file
104 atf_check test ! -f file
105 atf_check test ! -f file.Z
117 atf_check sh -c "echo 'hello' > file"
121 -e 'inline:uncompress: file.Z: No such file or directory\n' \
122 uncompress -f file
124 atf_check -o 'inline:hello\n' cat file
125 atf_check test ! -f file.Z
135 echo 'broken' > file.Z
139 -e 'inline:uncompress: file.Z: Inappropriate file type or format\n' \
140 uncompress -f file
142 atf_check test ! -f file
143 atf_check test -f file.Z
156 echo 'broken' > file.Z
157 echo 'before' > file
161 -e 'inline:uncompress: file.Z: Inappropriate file type or format\n' \
162 uncompress -f file.Z
164 atf_check -o 'inline:broken\n' cat file.Z
165 atf_check -o 'inline:before\n' cat file