From: Rafael Garcia-Suarez Date: Mon, 7 Sep 2009 09:30:18 +0000 (+0200) Subject: Add missing files from the Encode CPAN distribution X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b3f8c6ea983e616c76ee38885a4c0847880c8ed7;p=p5sagit%2Fp5-mst-13.2.git Add missing files from the Encode CPAN distribution --- diff --git a/MANIFEST b/MANIFEST index bde4f33..28f5713 100644 --- a/MANIFEST +++ b/MANIFEST @@ -609,6 +609,8 @@ ext/Encode/lib/Encode/PerlIO.pod Documents for Encode & PerlIO ext/Encode/lib/Encode/Supported.pod Documents for supported encodings ext/Encode/lib/Encode/Unicode/UTF7.pm Encode extension ext/Encode/Makefile.PL Encode extension makefile writer +ext/Encode/MANIFEST Encode MANIFEST +ext/Encode/META.yml Encode META.yml ext/Encode/README Encode extension ext/Encode/Symbol/Makefile.PL Encode extension ext/Encode/Symbol/Symbol.pm Encode extension @@ -650,6 +652,7 @@ ext/Encode/t/mime-header.t test script ext/Encode/t/mime-name.t test script ext/Encode/t/Mod_EUCJP.pm module that t/enc_module.enc uses ext/Encode/t/perlio.t test script +ext/Encode/t/piconv.t Test for piconv.t ext/Encode/t/rt.pl test script ext/Encode/t/unibench.pl benchmark script ext/Encode/t/Unicode.t test script diff --git a/ext/Encode/MANIFEST b/ext/Encode/MANIFEST new file mode 100644 index 0000000..48fa143 --- /dev/null +++ b/ext/Encode/MANIFEST @@ -0,0 +1,203 @@ +AUTHORS List of authors +Byte/Byte.pm Encode extension +Byte/Makefile.PL Encode extension +CN/CN.pm Encode extension +CN/Makefile.PL Encode extension +Changes Change Log +EBCDIC/EBCDIC.pm Encode extension +EBCDIC/Makefile.PL Encode extension +Encode.pm Mother of all Encode extensions +Encode.xs Encode extension +Encode/Changes.e2x Skeleton file for enc2xs +Encode/ConfigLocal_PM.e2x Skeleton file for enc2xs +Encode/Makefile_PL.e2x Skeleton file for enc2xs +Encode/README.e2x Skeleton file for enc2xs +Encode/_PM.e2x Skeleton file for enc2xs +Encode/_T.e2x Skeleton file for enc2xs +Encode/encode.h Encode extension header file +JP/JP.pm Encode extension +JP/Makefile.PL Encode extension +KR/KR.pm Encode extension +KR/Makefile.PL Encode extension +MANIFEST Encode extension +META.yml Module meta-data in YAML +Makefile.PL Encode extension makefile writer +README Encode extension +Symbol/Makefile.PL Encode extension +Symbol/Symbol.pm Encode extension +TW/Makefile.PL Encode extension +TW/TW.pm Encode extension +Unicode/Makefile.PL Encode extension +Unicode/Unicode.pm Encode extension +Unicode/Unicode.xs Encode extension +bin/enc2xs Encode module generator +bin/piconv iconv by perl +bin/ucm2table Table Generator for testing +bin/ucmlint A UCM Lint utility +bin/ucmsort Sorts UCM lines +bin/unidump Unicode Dump like hexdump(1) +encengine.c Encode extension +encoding.pm Perl Pragmactic Module +lib/Encode/Alias.pm Encode extension +lib/Encode/CJKConstants.pm Encode extension +lib/Encode/CN/HZ.pm Encode extension +lib/Encode/Config.pm Encode configuration module +lib/Encode/Encoder.pm OO Encoder +lib/Encode/Encoding.pm Encode extension +lib/Encode/GSM0338.pm Encode extension +lib/Encode/Guess.pm Encode Extension +lib/Encode/JP/H2Z.pm Encode extension +lib/Encode/JP/JIS7.pm Encode extension +lib/Encode/KR/2022_KR.pm Encode extension +lib/Encode/MIME/Header.pm Encode extension +lib/Encode/MIME/Header/ISO_2022_JP.pm Encode extension +lib/Encode/MIME/Name.pm Encode extension +lib/Encode/PerlIO.pod Documents for Encode & PerlIO +lib/Encode/Supported.pod Documents for supported encodings +lib/Encode/Unicode/UTF7.pm Encode Extension +t/Aliases.t test script +t/CJKT.t test script +t/Encode.t test script +t/Encoder.t test script +t/Mod_EUCJP.pm module that t/enc_module.enc uses +t/Unicode.t test script +t/at-cn.t test script +t/at-tw.t test script +t/big5-eten.enc test data +t/big5-eten.utf test data +t/big5-hkscs.enc test data +t/big5-hkscs.utf test data +t/enc_data.t test script for encoding.pm vs. DATA fh +t/enc_eucjp.t test script +t/enc_module.enc test data for t/enc_module.t +t/enc_module.t test script +t/enc_utf8.t test script +t/encoding.t test script +t/fallback.t test script +t/from_to.t test script +t/gb2312.enc test data +t/gb2312.utf test data +t/grow.t test script +t/gsm0338.t test script +t/guess.t test script +t/jis7-fallback.t test script +t/jisx0201.enc test data +t/jisx0201.utf test data +t/jisx0208.enc test data +t/jisx0208.utf test data +t/jisx0212.enc test data +t/jisx0212.utf test data +t/jperl.t test script +t/ksc5601.enc test data +t/ksc5601.utf test data +t/mime-header.t test script +t/mime-name.t test script +t/mime_header_iso2022jp.t test script +t/perlio.t test script +t/piconv.t test script +t/rt.pl even more test script +t/unibench.pl benchmark script +t/utf8strict.t test script +ucm/8859-1.ucm Unicode Character Map +ucm/8859-10.ucm Unicode Character Map +ucm/8859-11.ucm Unicode Character Map +ucm/8859-13.ucm Unicode Character Map +ucm/8859-14.ucm Unicode Character Map +ucm/8859-15.ucm Unicode Character Map +ucm/8859-16.ucm Unicode Character Map +ucm/8859-2.ucm Unicode Character Map +ucm/8859-3.ucm Unicode Character Map +ucm/8859-4.ucm Unicode Character Map +ucm/8859-5.ucm Unicode Character Map +ucm/8859-6.ucm Unicode Character Map +ucm/8859-7.ucm Unicode Character Map +ucm/8859-8.ucm Unicode Character Map +ucm/8859-9.ucm Unicode Character Map +ucm/adobeStdenc.ucm Unicode Character Map +ucm/adobeSymbol.ucm Unicode Character Map +ucm/adobeZdingbat.ucm Unicode Character Map +ucm/ascii.ucm Unicode Character Map +ucm/big5-eten.ucm Unicode Character Map +ucm/big5-hkscs.ucm Unicode Character Map +ucm/cp037.ucm Unicode Character Map +ucm/cp1006.ucm Unicode Character Map +ucm/cp1026.ucm Unicode Character Map +ucm/cp1047.ucm Unicode Character Map +ucm/cp1250.ucm Unicode Character Map +ucm/cp1251.ucm Unicode Character Map +ucm/cp1252.ucm Unicode Character Map +ucm/cp1253.ucm Unicode Character Map +ucm/cp1254.ucm Unicode Character Map +ucm/cp1255.ucm Unicode Character Map +ucm/cp1256.ucm Unicode Character Map +ucm/cp1257.ucm Unicode Character Map +ucm/cp1258.ucm Unicode Character Map +ucm/cp424.ucm Unicode Character Map +ucm/cp437.ucm Unicode Character Map +ucm/cp500.ucm Unicode Character Map +ucm/cp737.ucm Unicode Character Map +ucm/cp775.ucm Unicode Character Map +ucm/cp850.ucm Unicode Character Map +ucm/cp852.ucm Unicode Character Map +ucm/cp855.ucm Unicode Character Map +ucm/cp856.ucm Unicode Character Map +ucm/cp857.ucm Unicode Character Map +ucm/cp858.ucm Unicode Character Map +ucm/cp860.ucm Unicode Character Map +ucm/cp861.ucm Unicode Character Map +ucm/cp862.ucm Unicode Character Map +ucm/cp863.ucm Unicode Character Map +ucm/cp864.ucm Unicode Character Map +ucm/cp865.ucm Unicode Character Map +ucm/cp866.ucm Unicode Character Map +ucm/cp869.ucm Unicode Character Map +ucm/cp874.ucm Unicode Character Map +ucm/cp875.ucm Unicode Character Map +ucm/cp932.ucm Unicode Character Map +ucm/cp936.ucm Unicode Character Map +ucm/cp949.ucm Unicode Character Map +ucm/cp950.ucm Unicode Character Map +ucm/ctrl.ucm Unicode Character Map +ucm/dingbats.ucm Unicode Character Map +ucm/euc-cn.ucm Unicode Character Map +ucm/euc-jp.ucm Unicode Character Map +ucm/euc-kr.ucm Unicode Character Map +ucm/gb12345.ucm Unicode Character Map +ucm/gb2312.ucm Unicode Character Map +ucm/hp-roman8.ucm Unicode Character Map +ucm/ir-165.ucm Unicode Character Map +ucm/jis0201.ucm Unicode Character Map +ucm/jis0208.ucm Unicode Character Map +ucm/jis0212.ucm Unicode Character Map +ucm/johab.ucm Unicode Character Map +ucm/koi8-f.ucm Unicode Character Map +ucm/koi8-r.ucm Unicode Character Map +ucm/koi8-u.ucm Unicode Character Map +ucm/ksc5601.ucm Unicode Character Map +ucm/macArabic.ucm Unicode Character Map +ucm/macCentEuro.ucm Unicode Character Map +ucm/macChinsimp.ucm Unicode Character Map +ucm/macChintrad.ucm Unicode Character Map +ucm/macCroatian.ucm Unicode Character Map +ucm/macCyrillic.ucm Unicode Character Map +ucm/macDingbats.ucm Unicode Character Map +ucm/macFarsi.ucm Unicode Character Map +ucm/macGreek.ucm Unicode Character Map +ucm/macHebrew.ucm Unicode Character Map +ucm/macIceland.ucm Unicode Character Map +ucm/macJapanese.ucm Unicode Character Map +ucm/macKorean.ucm Unicode Character Map +ucm/macROMnn.ucm Unicode Character Map +ucm/macRUMnn.ucm Unicode Character Map +ucm/macRoman.ucm Unicode Character Map +ucm/macSami.ucm Unicode Character Map +ucm/macSymbol.ucm Unicode Character Map +ucm/macThai.ucm Unicode Character Map +ucm/macTurkish.ucm Unicode Character Map +ucm/macUkraine.ucm Unicode Character Map +ucm/nextstep.ucm Unicode Character Map +ucm/null.ucm Unicode Character Map +ucm/posix-bc.ucm Unicode Character Map +ucm/shiftjis.ucm Unicode Character Map +ucm/symbol.ucm Unicode Character Map +ucm/viscii.ucm Unicode Character Map diff --git a/ext/Encode/META.yml b/ext/Encode/META.yml new file mode 100644 index 0000000..85a3cd0 --- /dev/null +++ b/ext/Encode/META.yml @@ -0,0 +1,20 @@ +--- #YAML:1.0 +name: Encode +version: 2.37 +abstract: ~ +author: [] +license: unknown +distribution_type: module +configure_requires: + ExtUtils::MakeMaker: 0 +build_requires: + ExtUtils::MakeMaker: 0 +requires: {} +no_index: + directory: + - t + - inc +generated_by: ExtUtils::MakeMaker version 6.54 +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 diff --git a/ext/Encode/t/piconv.t b/ext/Encode/t/piconv.t new file mode 100644 index 0000000..e477f04 --- /dev/null +++ b/ext/Encode/t/piconv.t @@ -0,0 +1,103 @@ +# +# $Id: piconv.t,v 0.2 2009/07/13 00:50:52 dankogai Exp $ +# + +BEGIN { + if ( $ENV{'PERL_CORE'} ) { + print "1..0 # Skip: Don't know how to test this within perl's core\n"; + exit 0; + } +} + +use strict; +use FindBin; +use File::Spec; +use IPC::Open3 qw(open3); +use IO::Select; +use Test::More; + +my $WIN = $^O eq 'MSWin32'; + +if ($WIN) { + eval { require IPC::Run; IPC::Run->VERSION(0.83); 1; } or + plan skip_all => 'Win32 environments require IPC::Run 0.83 to complete this test'; +} + +sub run_cmd (;$$); + +my $blib = + File::Spec->rel2abs( + File::Spec->catdir( $FindBin::RealBin, File::Spec->updir, 'blib' ) ); +my $script = File::Spec->catdir($blib, 'script', 'piconv'); +my @base_cmd = ( $^X, "-Mblib=$blib", $script ); + +plan tests => 5; + +{ + my ( $st, $out, $err ) = run_cmd; + is( $st, 0, 'status for usage call' ); + is( $out, $WIN ? undef : '' ); + like( $err, qr{^piconv}, 'usage' ); +} + +{ + my($st, $out, $err) = run_cmd [qw(-S foobar -f utf-8 -t ascii), $script]; + like($err, qr{unknown scheme.*fallback}i, 'warning for unknown scheme'); +} + +{ + my ( $st, $out, $err ) = run_cmd [qw(-f utf-8 -t ascii ./non-existing/file)]; + like( $err, qr{can't open}i ); +} + +sub run_cmd (;$$) { + my ( $args, $in ) = @_; + + my $out = "x" x 10_000; + $out = ""; + my $err = "x" x 10_000; + $err = ""; + + if ($WIN) { + IPC::Run->import(qw(run timeout)); + my @cmd; + if (defined $args) { + @cmd = (@base_cmd, @$args); + } else { + @cmd = @base_cmd; + } + run(\@cmd, \$in, \$out, \$err, timeout(10)); + my $st = $?; + $out = undef if ($out eq ''); + ( $st, $out, $err ); + } else { + $in ||= ''; + my ( $in_fh, $out_fh, $err_fh ); + use Symbol 'gensym'; + $err_fh = + gensym; # sigh... otherwise stderr gets just to $out_fh, not to $err_fh + my $pid = open3( $in_fh, $out_fh, $err_fh, @base_cmd, @$args ) + or die "Can't run @base_cmd @$args: $!"; + print $in_fh $in; + my $sel = IO::Select->new( $out_fh, $err_fh ); + + while ( my @ready = $sel->can_read ) { + for my $fh (@ready) { + if ( eof($fh) ) { + $sel->remove($fh); + last if !$sel->handles; + } + elsif ( $out_fh == $fh ) { + my $line = <$fh>; + $out .= $line; + } + elsif ( $err_fh == $fh ) { + my $line = <$fh>; + $err .= $line; + } + } + } + my $st = $?; + ( $st, $out, $err ); + } +}