OSDN Git Service

Examine the printf command to pass the test13 on MacOS X
[lha/lha.git] / tests / lha-test13
index 6447bf6..ad6b273 100644 (file)
@@ -1,11 +1,24 @@
 # -*- shell-script -*-
 message testing the kanji code conversion.
 
-# printf '\xb4\xc1\xbb\xfa\n' > test-tmp-euc
-echo abcd | LANG=C tr abcd '\264\301\273\372'  > test-tmp-euc
-                                                       check $? $LINENO
-# printf '\x8a\xbf\x8e\x9a\n' > test-tmp-sjis
-echo abcd | LANG=C tr abcd '\212\277\216\232'  > test-tmp-sjis
+uname >&2
+case $(uname) in
+Darwin*)
+  printf '\xb4\xc1\xbb\xfa\n' > test-tmp-euc
+  ;;
+*)
+  echo abcd | LANG=C tr abcd '\264\301\273\372'  > test-tmp-euc
+  ;;
+esac
+                                                       check $? $LINENO
+case $(uname) in
+Darwin*)
+  printf '\x8a\xbf\x8e\x9a\n' > test-tmp-sjis
+  ;;
+*)
+  echo abcd | LANG=C tr abcd '\212\277\216\232'  > test-tmp-sjis
+  ;;
+esac
                                                        check $? $LINENO
 # no convert
 $lha c test-tmp-euc.lzh test-tmp-euc
@@ -28,22 +41,26 @@ diff -r test-tmp-sjis test-tmp-unknown-d/test-tmp-euc 2>/dev/null
 test $? -ne 0
                                                        check $? $LINENO
 
-# euc to sjis (NL to CR NL)
+# euc to sjis (LF to CR LF)
 $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 | egrep lh0
                                                        check $? $LINENO
-# no convert (CR NL to NL)
+# no convert (CR LF to LF)
 $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)
+od -ct x1 test-tmp-sjis >&2
+od -ct x1 test-tmp-sjis-d/test-tmp-euc >&2
+# sjis to euc (CR LF to LF)
 $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
+od -ct x1 test-tmp-euc >&2
+od -ct x1 test-tmp-euc-d2/test-tmp-euc >&2
 
 i=0
 while ((i < 10))
@@ -79,17 +96,17 @@ diff -r test-tmp-sjis2 test-tmp-unknown2-d/test-tmp-euc2 2>/dev/null
 test $? -ne 0
                                                        check $? $LINENO
 
-# euc to sjis (NL to CR NL)
+# euc to sjis (LF to CR LF)
 $lha ce test-tmp-sjis2.lzh test-tmp-euc2
                                                        check $? $LINENO
 $lha v test-tmp-euc2.lzh | egrep 'lh[567]'
                                                        check $? $LINENO
-# no convert (CR NL to NL)
+# no convert (CR LF to LF)
 $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)
+# sjis to euc (CR LF to LF)
 $lha xew=test-tmp-euc2-d2 test-tmp-sjis2.lzh
                                                        check $? $LINENO
 diff test-tmp-euc2 test-tmp-euc2-d2/test-tmp-euc2