view nkf-utf8/make_test.pl @ 12:441a2190cfae

Lion fix
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 21 Apr 2012 13:10:49 +0900
parents
children
line wrap: on
line source

#!/usr/bin/perl
while ( <test_data/*.cmd> ) {
    $file = $_; 
    $test = $file; $test =~ s/\.cmd$//;
    $out = $test.".out"; $out = `cat $out`;
    $in = $test.".in"; $in = `cat $in`;
    $opt = `cat $file`; chomp($opt);

    $inpack = pack('u',$in); chomp($inpack);
    $outpack = pack('u',$out); chomp($outpack);

print << "EOFEOF";
# $test

\$example{'$test'} = unpack('u',<<'eofeof');
$inpack
eofeof

\$example{'$test.ans'} = unpack('u',<<'eofeof');
$outpack
eofeof

print "$test    ";
    \&test("\$nkf $opt",\$example{'$test'},\$example{'$test.ans'});
EOFEOF

}