diff options
author | Steve Peters <steve@fisharerojo.org> | 2005-12-12 13:21:03 +0000 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2005-12-12 13:21:03 +0000 |
commit | 81369493be23c42564698eadb95821143b16ec58 (patch) | |
tree | d167ade5d446d35fe22957996ea759f889b0a3b9 /lib/Pod/t | |
parent | 86bd3ff0f72010ac13cd4d60dd1f2acb3f324f47 (diff) | |
download | perl-81369493be23c42564698eadb95821143b16ec58.tar.gz |
Pod::Man's tests aren't Unicode friendly. Let's skip the unfriendly
test for now.
p4raw-id: //depot/perl@26329
Diffstat (limited to 'lib/Pod/t')
-rw-r--r-- | lib/Pod/t/man.t | 78 |
1 files changed, 53 insertions, 25 deletions
diff --git a/lib/Pod/t/man.t b/lib/Pod/t/man.t index a4fc58e933..8418939c32 100644 --- a/lib/Pod/t/man.t +++ b/lib/Pod/t/man.t @@ -29,7 +29,59 @@ use Pod::Man; $loaded = 1; print "ok 1\n"; -my $n = 2; +SKIP: { + if (defined $ENV{PERL_UNICODE}) { + print "not ok 2 # skip Unicode not yet supported\n" + } else { + my $pod = <<EOP; +=head1 ACCENTS + +Beyoncé! Beyoncé! Beyoncé!! + + Beyoncé! Beyoncé! + Beyoncé! Beyoncé! + Beyoncé! Beyoncé! + +Older versions didn't convert Beyoncé in verbatim. +EOP + + my $expected = <<"EOM"; +.SH "ACCENTS" +.IX Header "ACCENTS" +Beyonce\\*'! Beyonce\\*'! Beyonce\\*'!! +.PP +.Vb 3 +\\& Beyonce\\*'! Beyonce\\*'! +\\& Beyonce\\*'! Beyonce\\*'! +\\& Beyonce\\*'! Beyonce\\*'! +.Ve +.PP +Older versions didn't convert Beyonce\\*' in verbatim. +EOM + $parser = Pod::Man->new or die "Cannot create parser\n"; + open my $out_fh, ">", 'out.tmp' or die "Can't open \$out_fh: $!"; + $parser->output_fh($out_fh); + $parser->parse_string_document($pod); + close $out_fh; + open my $in_fh, "<", 'out.tmp' or die "Can't open \$in_fh: $!"; + while (<$in_fh>) { last if /^\.TH/; } + my $man; + { + local $/ = undef; + $man = <$in_fh>; + } + close $in_fh; + unlink 'out.tmp'; + if ($man eq $expected) { + print "ok 2\n"; + } else { + print "not ok 2\n"; + print "Expected\n========\n$expected\nOutput\n======\n$man\n"; + } + } +} + +my $n = 3; while (<DATA>) { next until $_ eq "###\n"; open (TMP, '> tmp.pod') or die "Cannot create tmp.pod: $!\n"; @@ -140,30 +192,6 @@ Also not a bullet. ### ### -=head1 ACCENTS - -Beyoncé! Beyoncé! Beyoncé!! - - Beyoncé! Beyoncé! - Beyoncé! Beyoncé! - Beyoncé! Beyoncé! - -Older versions didn't convert Beyoncé in verbatim. -### -.SH "ACCENTS" -.IX Header "ACCENTS" -Beyonce\*'! Beyonce\*'! Beyonce\*'!! -.PP -.Vb 3 -\& Beyonce\*'! Beyonce\*'! -\& Beyonce\*'! Beyonce\*'! -\& Beyonce\*'! Beyonce\*'! -.Ve -.PP -Older versions didn't convert Beyonce\*' in verbatim. -### - -### =over 4 =item 1. Not a number |