X-Git-Url: http://git.maemo.org/git/?p=dh-make-perl;a=blobdiff_plain;f=dev%2Fi386%2Flibpod-simple-perl%2Flibpod-simple-perl-3.07%2Ft%2Fencod01.t;fp=dev%2Fi386%2Flibpod-simple-perl%2Flibpod-simple-perl-3.07%2Ft%2Fencod01.t;h=0f83dcc3e27ed4744f0acfedd5f6ed8d61f1757e;hp=0000000000000000000000000000000000000000;hb=8977e561d8a9eae6959218b0306c9df2056a38a9;hpb=df794b845212301ea0d267c919232538bfef356a diff --git a/dev/i386/libpod-simple-perl/libpod-simple-perl-3.07/t/encod01.t b/dev/i386/libpod-simple-perl/libpod-simple-perl-3.07/t/encod01.t new file mode 100644 index 0000000..0f83dcc --- /dev/null +++ b/dev/i386/libpod-simple-perl/libpod-simple-perl-3.07/t/encod01.t @@ -0,0 +1,75 @@ +# encoding nonesuch +BEGIN { + if($ENV{PERL_CORE}) { + chdir 't'; + @INC = '../lib'; + } +} + +#use Pod::Simple::Debug (10); +use Test; +use File::Spec; +#use utf8; +use strict; +#use Pod::Simple::Debug (10); + +BEGIN { plan tests => 6 } + +use Pod::Simple; +use Pod::Simple::DumpAsXML; + +my $thefile; + + +BEGIN { + + # Find the path to the test source files. This requires some fiddling when +# these tests are run as part of Perl core. +sub source_path { + my $file = shift; + if ($ENV{PERL_CORE}) { + require File::Spec; + my $updir = File::Spec->updir; + my $dir = File::Spec->catdir ($updir, 'lib', 'Pod', 'Simple', 't', 'corpus'); + return File::Spec->catfile ($dir, $file); + } else { + return $file; + } +} + if( -e + ($thefile = source_path('nonesuch.txt')) + #or (print("# Nope, not $thefile\n"), 0) + ) { + # okay, + + } elsif( -e + ($thefile = File::Spec::->catfile( File::Spec::->curdir, 'corpus', 'nonesuch.txt' )) + #or (print("# Nope, not $thefile\n"), 0) + ) { + # okay, + } elsif (-e + ($thefile = File::Spec::->catfile( File::Spec::->curdir, 't', 'corpus', 'nonesuch.txt' )) + #or (print("# Nope, not $thefile\n"), 0) + ) { + # okay, + } else { + die "Can't find the corpus directory\n Aborting"; + } + +} + +print "# Testing that $thefile parses right.\n"; +my $outstring; +{ + my $p = Pod::Simple::DumpAsXML->new; + $p->output_string( \$outstring ); + $p->parse_file( $thefile ); + undef $p; +} +ok 1 ; # make sure it parsed at all +ok( $outstring && length($outstring) ); # make sure it parsed to something. +#print $outstring; +ok( $outstring =~ m/Blorp/ ); +ok( $outstring =~ m/errata/ ); +ok( $outstring =~ m/unsupported/ ); +ok 1;