3 : ${lha=@top_builddir@/src/lha}
5 trap "rm -rf test-*" 0 1 2 3 15
7 declare -i test_number=0
17 ((test_number = test_number + 1))
19 if [[ $status -eq 0 ]]; then
20 message test $test_number ... ok
22 message test $test_number ... failed
28 message testing to create/list/extract lha archive.
34 sed 's/foo/bar/g' < test-a > test-b
35 sed 's/foo/baz/g' < test-a > test-c
37 $lha c test-1.lzh test-a test-b test-c
45 test -d test-1 || mkdir test-1
49 diff test-1/test-a test-a
51 diff test-1/test-b test-b
53 diff test-1/test-c test-c
56 message testing to generic, lh5, lh6 and lh7 method archive.
57 $lha co test-m1.lzh test-a test-b test-c
59 $lha co5 test-m5.lzh test-a test-b test-c
61 $lha co6 test-m6.lzh test-a test-b test-c
63 $lha co7 test-m7.lzh test-a test-b test-c
65 $lha v test-m1.lzh | grep lh1
67 $lha v test-m5.lzh | grep lh5
69 $lha v test-m6.lzh | grep lh6
71 $lha v test-m7.lzh | grep lh7
74 $lha xw=test-m1 test-m1.lzh
76 $lha xw=test-m5 test-m5.lzh
78 $lha xw=test-m6 test-m6.lzh
80 $lha xw=test-m7 test-m7.lzh
83 diff -r test-1 test-m1
85 diff -r test-1 test-m5
87 diff -r test-1 test-m6
89 diff -r test-1 test-m7
92 message testing to print lha archive.
94 $lha pq test-m1.lzh test-a | diff test-a -
96 $lha pq test-m5.lzh test-a | diff test-a -
98 $lha pq test-m6.lzh test-a | diff test-a -
100 $lha pq test-m7.lzh test-a | diff test-a -
103 cat test-[abc] > test-abc
104 $lha pq test-m1.lzh | diff test-abc -
106 $lha pq test-m5.lzh | diff test-abc -
108 $lha pq test-m6.lzh | diff test-abc -
110 $lha pq test-m7.lzh | diff test-abc -
113 message testing to delete files from archive.
115 cp test-m5.lzh test-2.lzh
118 $lha d test-2.lzh 2> test-stderr
122 $lha d test-2.lzh test-a
124 $lha xw=test-2 test-2.lzh
125 diff -r test-m5 test-2 2>&1 | grep -v '^Only in test-m5: test-a'
130 $lha d test-2.lzh test-b
132 $lha xw=test-2 test-2.lzh
133 diff -r test-m5 test-2 2>&1 |
134 grep -v '^Only in test-m5: test-a$' |
135 grep -v '^Only in test-m5: test-b$'
140 $lha d test-2.lzh test-c 2> test-stderr
147 message testing to treat stdin/stdout as archive file.
149 $lha c - test-a test-b test-c > test-3.lzh
151 cat test-3.lzh | $lha xw=test-3 -
153 diff -r test-m5 test-3