# vim: set ts=2 sts=2 sw=2 expandtab smarttab: use strict; use warnings; use Test::More; use Pod::Markdown; my $pod_prefix = 'http://search.cpan.org/perldoc?'; my $man_prefix = 'http://man.he.net/man'; my $parser = Pod::Markdown->new; my @tests = ( [I => q, q{_italic_}], [B => q, q{__bold__}], [C => q, q{`code`}], # links tested extensively in t/links.t [L => q, "[link](${pod_prefix}link)"], [E => q, q{<}], [E => q, q{>}], [E => q, q{|}], [E => q, q{/}], [E => q, q{é}], [E => q<0x201E>, q{„}, 'E hex'], [E => q<075>, q{=}, 'E octal'], [E => q<181>, q{µ}, 'E decimal'], # legacy charnames specifically mentioned by perlpodspec [E => q, q{«}], [E => q, q{»}], [E => q, q{&zchevron;}], [E => q, q{&rchevrony;}], [F => q, q{`file.ext`}], [S => q<$x ? $y : $z>, q{$x ? $y : $z}], [X => q, q{}], [Z => q, q{}], [Q => q, q{Q}, 'uknown code (Q<>)' ], ); plan tests => scalar @tests * 2; foreach my $test ( @tests ){ my ($code, $text, $exp, $desc) = @$test; $desc ||= "$code<$text>"; # explicitly test interior_sequence (which is what we've defined) is $parser->interior_sequence($code => $text), $exp, $desc . ' (interior_sequence)'; # also test parsing it as pod is $parser->interpolate("$code<<< $text >>>"), $exp, $desc . ' (interpolate)'; }