|
Revision 33791, 1.3 kB
(checked in by argrath, 4 years ago)
|
|
Checking in changes prior to tagging of version 0.03_02. Changelog diff is:
Index: Changes
===================================================================
--- Changes (リビジョン 33769)
+++ Changes (作業コピー)
@@ -1,5 +1,9 @@
Revision history for Perl extension Pod::L10N.
+0.03_02 Thu Jun 5 00:57:10 JST 2009
+
+ - eliminate some warnings
+
0.03_01 Thu Jun 4 00:23:12 JST 2009
- change base to Pod::Html 1.09_04
|
-
Property svn:executable set to
*
|
| Line | |
|---|
| 1 | use Test::More tests => 1; |
|---|
| 2 | |
|---|
| 3 | use Cwd; |
|---|
| 4 | use Pod::L10N::Html; |
|---|
| 5 | use Config; |
|---|
| 6 | use File::Spec::Functions; |
|---|
| 7 | |
|---|
| 8 | BEGIN { |
|---|
| 9 | chdir 't' if -d 't'; |
|---|
| 10 | unshift @INC, qw( ../lib ../lib/Pod/t ); |
|---|
| 11 | } |
|---|
| 12 | |
|---|
| 13 | END { |
|---|
| 14 | # pod2html creates these |
|---|
| 15 | 1 while unlink "pod2htmd.tmp"; |
|---|
| 16 | 1 while unlink "pod2htmi.tmp"; |
|---|
| 17 | } |
|---|
| 18 | |
|---|
| 19 | my $CWD = Cwd::cwd(); |
|---|
| 20 | my $CACHEDIR = "$CWD/subdir"; |
|---|
| 21 | |
|---|
| 22 | # l10n conversion |
|---|
| 23 | convert_ok("substitute.pod", "substitute.html", "l10n substitution"); |
|---|
| 24 | |
|---|
| 25 | sub slurp { |
|---|
| 26 | my $file = shift; |
|---|
| 27 | open my $in, $file or die "cannot open $file for input: $!"; |
|---|
| 28 | local $/ = undef; |
|---|
| 29 | my $rec = <$in>; |
|---|
| 30 | close $in; |
|---|
| 31 | return $rec; |
|---|
| 32 | } |
|---|
| 33 | |
|---|
| 34 | sub convert_ok { |
|---|
| 35 | my $podfile = shift; |
|---|
| 36 | my $htmlfile = shift; |
|---|
| 37 | my $testname = shift; |
|---|
| 38 | my @extra_args = @{shift || []}; |
|---|
| 39 | |
|---|
| 40 | my $base_dir = catdir $CWD, updir(), $ENV{PERL_CORE} ? ("lib", "Pod") : (curdir()); |
|---|
| 41 | my $infile = $podfile; |
|---|
| 42 | my $outfile = "$htmlfile-t"; |
|---|
| 43 | |
|---|
| 44 | Pod::L10N::Html::pod2html( |
|---|
| 45 | "--podpath=t", |
|---|
| 46 | "--podroot=$base_dir", |
|---|
| 47 | "--infile=$infile", |
|---|
| 48 | "--outfile=$outfile", |
|---|
| 49 | @extra_args, |
|---|
| 50 | ); |
|---|
| 51 | |
|---|
| 52 | my $result = slurp($outfile); |
|---|
| 53 | |
|---|
| 54 | my $expect = slurp($htmlfile); |
|---|
| 55 | $expect =~ s/\[PERLADMIN\]/$Config::Config{perladmin}/; |
|---|
| 56 | |
|---|
| 57 | is($expect, $result, $testname) and do { |
|---|
| 58 | # remove the results if the test succeeded |
|---|
| 59 | 1 while unlink $outfile; |
|---|
| 60 | }; |
|---|
| 61 | } |
|---|
| 62 | |
|---|