From 4ea30891cd16bf14d6a807c9e43056bae44bb66c Mon Sep 17 00:00:00 2001 From: arai Date: Sun, 11 Aug 2002 09:44:03 +0000 Subject: [PATCH] * tests/lha-test.in, tests/lha-test12, tests/lha-test13: added tests converting text files. git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/lha/lha/trunk@469 6a8cc165-1e22-0410-a132-eb4e3f353aba --- tests/lha-test.in | 2 ++ tests/lha-test12 | 34 ++++++++++++++++++++++ tests/lha-test13 | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 123 insertions(+) create mode 100644 tests/lha-test12 create mode 100644 tests/lha-test13 diff --git a/tests/lha-test.in b/tests/lha-test.in index 40a60be..2af8fc0 100644 --- a/tests/lha-test.in +++ b/tests/lha-test.in @@ -96,6 +96,8 @@ case `$lha --version 2>&1` in esac . $srcdir/lha-test10; cleanup . $srcdir/lha-test11; cleanup +. $srcdir/lha-test12; cleanup +. $srcdir/lha-test13; cleanup if (( $error_num != 0 )); then echo $error_num tests failed! >&2 diff --git a/tests/lha-test12 b/tests/lha-test12 new file mode 100644 index 0000000..75a7184 --- /dev/null +++ b/tests/lha-test12 @@ -0,0 +1,34 @@ +# -*- shell-script -*- +message testing the end of line conversion. + +# NL to CR NL in archive +$lha ct test-tmp-crnl.lzh test-a test-b test-c + check $? $LINENO +# no convert +$lha xw=test-tmp-crnl test-tmp-crnl.lzh + check $? $LINENO +diff -r test-1 test-tmp-crnl +test $? -ne 0 + check $? $LINENO +sed -e 's/$/ +/' < test-a | diff test-tmp-crnl/test-a - + check $? $LINENO +sed -e 's/$/ +/' < test-b | diff test-tmp-crnl/test-b - + check $? $LINENO +sed -e 's/$/ +/' < test-c | diff test-tmp-crnl/test-c - + check $? $LINENO +# CR NL to NL +$lha xtw=test-tmp-nl test-tmp-crnl.lzh + check $? $LINENO +diff -r test-1 test-tmp-nl + check $? $LINENO +# no convert +$lha c test-tmp-nl.lzh test-a test-b test-c + check $? $LINENO +# CR NL to NL (cannot convert) +$lha xtw=test-tmp-nl2 test-tmp-nl.lzh + check $? $LINENO +diff -r test-1 test-tmp-nl2 + check $? $LINENO diff --git a/tests/lha-test13 b/tests/lha-test13 new file mode 100644 index 0000000..7414203 --- /dev/null +++ b/tests/lha-test13 @@ -0,0 +1,87 @@ +# -*- shell-script -*- +message testing the kanji code conversion. + +printf '\xb4\xc1\xbb\xfa\xc9\xbd\n' > test-tmp-euc + check $? $LINENO +printf '\x8a\xbf\x8e\x9a\x95\x5c\n' > test-tmp-sjis + check $? $LINENO +# no convert +$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 + check $? $LINENO +# no convert +$lha xw=test-tmp-euc-d test-tmp-euc.lzh + check $? $LINENO +diff -r test-tmp-euc test-tmp-euc-d/test-tmp-euc + check $? $LINENO +# sjis to euc +$lha xew=test-tmp-unknown-d test-tmp-euc.lzh + check $? $LINENO +diff -r test-tmp-euc test-tmp-unknown-d/test-tmp-euc +test $? -ne 0 + check $? $LINENO +diff -r test-tmp-sjis test-tmp-unknown-d/test-tmp-euc +test $? -ne 0 + check $? $LINENO + +# euc to sjis (NL to CR NL) +$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 + check $? $LINENO +# no convert (CR NL to NL) +$lha xtw=test-tmp-sjis-d test-tmp-sjis.lzh + check $? $LINENO +diff test-tmp-sjis test-tmp-sjis-d/test-tmp-euc + check $? $LINENO +# sjis to euc (CR NL to NL) +$lha xew=test-tmp-euc-d2 test-tmp-sjis.lzh + check $? $LINENO +diff test-tmp-euc test-tmp-euc-d2/test-tmp-euc + check $? $LINENO + +i=0 +while ((i++ < 100)) +do + cat test-tmp-euc >> test-tmp-euc2 + cat test-tmp-sjis >> test-tmp-sjis2 +done + +# no convert +$lha c test-tmp-euc2.lzh test-tmp-euc2 + check $? $LINENO +$lha v test-tmp-euc2.lzh | grep 'lh[567]' + check $? $LINENO +# no convert +$lha xw=test-tmp-euc2-d test-tmp-euc2.lzh + check $? $LINENO +diff -r test-tmp-euc2 test-tmp-euc2-d/test-tmp-euc2 + check $? $LINENO +# sjis to euc +$lha xew=test-tmp-unknown2-d test-tmp-euc2.lzh + check $? $LINENO +diff -r test-tmp-euc2 test-tmp-unknown2-d/test-tmp-euc2 +test $? -ne 0 + check $? $LINENO +diff -r test-tmp-sjis2 test-tmp-unknown2-d/test-tmp-euc2 +test $? -ne 0 + check $? $LINENO + +# 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]' + check $? $LINENO +# no convert (CR NL to NL) +$lha xtw=test-tmp-sjis2-d test-tmp-sjis2.lzh + check $? $LINENO +diff test-tmp-sjis2 test-tmp-sjis2-d/test-tmp-euc2 + check $? $LINENO +# sjis to euc (CR NL to NL) +$lha xew=test-tmp-euc2-d2 test-tmp-sjis2.lzh + check $? $LINENO +diff test-tmp-euc2 test-tmp-euc2-d2/test-tmp-euc2 + check $? $LINENO -- 2.11.0