typeset lineno=$2
if [[ $status -eq 0 ]]; then
message test $test_number ... ok
- echo at line $lineno
+ echo at line $lineno in $FILENAME
else
- message test $test_number ... failed at line $lineno
+ message test $test_number ... failed at line $lineno in $FILENAME
((error_num = error_num + 1))
error_tests="$error_tests #$test_number"
result=1
# create test data
message testing $lha
+
+# the `FILENAME' variable should be set the each test filename.
+FILENAME=lha-test
message testing to create/list/extract lha archive.
typeset -i i=0
# -*- shell-script -*-
+FILENAME=lha-test10
message testing header level 0, 1, 2 and each generic headers
$lha c0 test-tmp-h0.lzh test-1
check $? $LINENO
# -*- shell-script -*-
+FILENAME=lha-test11
message testing the long filename support
# long long filename
# assume that we are allowed to create 255 bytes filename (not path name).
# -*- shell-script -*-
+FILENAME=lha-test12
message testing the end of line conversion.
# NL to CR NL in archive
# -*- shell-script -*-
+FILENAME=lha-test13
message testing the kanji code conversion.
printf '\xb4\xc1\xbb\xfa\xc9\xbd\n' > test-tmp-euc
$lha c test-tmp-euc.lzh test-tmp-euc
check $? $LINENO
# file size is too small, so no compressed
-$lha v test-tmp-euc.lzh | grep lh0
+$lha v test-tmp-euc.lzh | egrep lh0
check $? $LINENO
# no convert
$lha xw=test-tmp-euc-d test-tmp-euc.lzh
$lha ce test-tmp-sjis.lzh test-tmp-euc
check $? $LINENO
# file size is too small, so no compressed
-$lha v test-tmp-euc.lzh | grep lh0
+$lha v test-tmp-euc.lzh | egrep lh0
check $? $LINENO
# no convert (CR NL to NL)
$lha xtw=test-tmp-sjis-d test-tmp-sjis.lzh
# no convert
$lha c test-tmp-euc2.lzh test-tmp-euc2
check $? $LINENO
-$lha v test-tmp-euc2.lzh | grep 'lh[567]'
+$lha v test-tmp-euc2.lzh | egrep 'lh[567]'
check $? $LINENO
# no convert
$lha xw=test-tmp-euc2-d test-tmp-euc2.lzh
# euc to sjis (NL to CR NL)
$lha ce test-tmp-sjis2.lzh test-tmp-euc2
check $? $LINENO
-$lha v test-tmp-euc2.lzh | grep 'lh[567]'
+$lha v test-tmp-euc2.lzh | egrep 'lh[567]'
check $? $LINENO
# no convert (CR NL to NL)
$lha xtw=test-tmp-sjis2-d test-tmp-sjis2.lzh
# -*- shell-script -*-
+FILENAME=lha-test2
message testing to lh0, lh1, lh5, lh6 and lh7 method archive.
$lha cz test-tmp-m0.lzh test-a test-b test-c
check $? $LINENO
check $? $LINENO
$lha pq test-tmp-m7.lzh | diff test-tmp-abc -
check $? $LINENO
-# 0 byte files should be frozen with the -lh0- method.
+# empty file should be frozen with the -lh0- method.
touch test-tmp-0byte
check $? $LINENO
$lha c test-tmp-0byte.lzh test-tmp-0byte
check $? $LINENO
$lha v test-tmp-0byte.lzh | grep lh0
check $? $LINENO
+# uncompressed file should be frozen with the -lh0- method.
+echo foobar > test-tmp-small
+ check $? $LINENO
+$lha c test-tmp-small.lzh test-tmp-small
+ check $? $LINENO
+$lha v test-tmp-small.lzh
+ check $? $LINENO
+$lha v test-tmp-small.lzh | grep lh0
+ check $? $LINENO
# -*- shell-script -*-
+FILENAME=lha-test3
message testing to generic format archive.
$lha czg test-tmp-m0g.lzh test-a test-b test-c
check $? $LINENO
# -*- shell-script -*-
+FILENAME=lha-test4
message testing to delete files from archive.
cp test-1.lzh test-tmp.lzh
# -*- shell-script -*-
+FILENAME=lha-test5
message testing to treat stdin/stdout as archive file.
$lha c - test-a test-b test-c > test-tmp.lzh
# -*- shell-script -*-
+FILENAME=lha-test6
message testing to treat stdin/stdout as file list.
message Warning: On MinGW, these tests will fail for now.
cat <<EOF | $lha c test-tmp.lzh
# -*- shell-script -*-
+FILENAME=lha-test7
message testing to add/update files to archive.
$lha a test-tmp.lzh test-c
check $? $LINENO
# -*- shell-script -*-
+FILENAME=lha-test8
message testing timestamp
# level 0 header
$lha c0 test-tmp-h0.lzh test-[abc]
# -*- shell-script -*-
+FILENAME=lha-test9
message 'testing overriding existing files (this test need the Ruby interpreter http://www.ruby-lang.org/)'
pty()