#!/usr/local/bin/perl
#
-# nkf test program for nkf 2.0
+# nkf test program for nkf-2
#
-# $Id: nkf_test.pl,v 1.6 2004/11/05 06:39:32 naruse Exp $
+# $Id: nkf_test.pl,v 1.7 2004/11/08 13:54:17 naruse Exp $
#
# Shinji KONO <kono@ie.u-ryukyu.ac.jp>
# Sun Aug 18 12:25:40 JST 1996
$input = $example{'jis'};
&test("$nkf -Be",$input,$example{'euc'});
+# test_data/cp932
+
+$example{'test_data/cp932'} = unpack('u',<<'eofeof');
+%^D`@_$L`
+eofeof
+
+$example{'test_data/cp932.ans'} = unpack('u',<<'eofeof');
+%_/$@_.X`
+eofeof
+
+print "test_data/cp932 ";
+ &test("$nkf -eS",$example{'test_data/cp932'},$example{'test_data/cp932.ans'});
+
+# test_data/cp932inv
+print "test_data/cp932inv ";
+ &test("$nkf -sE --cp932inv",$example{'test_data/cp932.ans'},$example{'test_data/cp932'});
+
+# test_data/no-cp932inv
+
+$example{'test_data/no-cp932inv.ans'} = unpack('u',<<'eofeof');
+%[N\@[NP`
+eofeof
+
+print "test_data/no-cp932inv ";
+ &test("$nkf -sE",$example{'test_data/cp932.ans'},$example{'test_data/no-cp932inv.ans'});
+
+# test_data/irv
+
+# $example{'test_data/irv'} = unpack('u',<<'eofeof');
+# %#B`/(!L`
+# eofeof
+#
+# $example{'test_data/irv.ans'} = unpack('u',<<'eofeof');
+# %#B`/(!L`
+# eofeof
+#
+# print "test_data/irv ";
+# &test("$nkf -wE",$example{'test_data/irv'},$example{'test_data/irv.ans'});
+
# UCS Mapping Test
print "\n\nUCS Mapping Test\n";
$tmp = &test("$nkf -jmNu",$example{'mime.iso2022'},$example{'mime.unbuf'},$example{'mime.unbuf.alt'});
# open(OUT,">tmp2");print OUT pack('u',$tmp);close(OUT);
print "MIME decode (base64) ";
- &test("$nkf -jTmB",$example{'mime.base64'},$example{'mime.base64.ans'});
+ &test("$nkf -jmB",$example{'mime.base64'},$example{'mime.base64.ans'});
+#MIME BASE64 must be LF?
# MIME ISO-8859-1
eofeof
print "test_data/long-fold-1 ";
- &test("$nkf -jTF60",$example{'test_data/long-fold-1'},$example{'test_data/long-fold-1.ans'});
+ &test("$nkf -jF60",$example{'test_data/long-fold-1'},$example{'test_data/long-fold-1.ans'});
# test_data/long-fold
$example{'test_data/long-fold'} = unpack('u',<<'eofeof');
eofeof
print "test_data/long-fold ";
- &test("$nkf -jTf60",$example{'test_data/long-fold'},$example{'test_data/long-fold.ans'});
+ &test("$nkf -jf60",$example{'test_data/long-fold'},$example{'test_data/long-fold.ans'});
# test_data/mime_out
$example{'test_data/mime_out'} = unpack('u',<<'eofeof');
eofeof
print "test_data/non-strict-mime ";
- &test("$nkf -jTmN",$example{'test_data/non-strict-mime'},$example{'test_data/non-strict-mime.ans'});
+ &test("$nkf -jmN",$example{'test_data/non-strict-mime'},$example{'test_data/non-strict-mime.ans'});
# test_data/q-encode-softrap
$example{'test_data/q-encode-softrap'} = unpack('u',<<'eofeof');
eofeof
print "test_data/q-encode-softrap ";
- &test("$nkf -jTmQ",$example{'test_data/q-encode-softrap'},$example{'test_data/q-encode-softrap.ans'});
+ &test("$nkf -jmQ",$example{'test_data/q-encode-softrap'},$example{'test_data/q-encode-softrap.ans'});
# test_data/rot13
$example{'test_data/rot13'} = unpack('u',<<'eofeof');