3 # color.t -- Additional specialized tests for Pod::Text::Color.
5 # Copyright 2002, 2004, 2006 by Russ Allbery <rra@stanford.edu>
7 # This program is free software; you may redistribute it and/or modify it
8 # under the same terms as Perl itself.
12 if ($ENV{PERL_CORE}) {
15 unshift (@INC, '../blib/lib');
17 unshift (@INC, '../blib/lib');
23 print "not ok 1\n" unless $loaded;
26 eval { require Term::ANSIColor };
29 print "ok $_ # skip\n";
34 require Pod::Text::Color;
39 my $parser = Pod::Text::Color->new or die "Cannot create parser\n";
42 next until $_ eq "###\n";
43 open (TMP, '> tmp.pod') or die "Cannot create tmp.pod: $!\n";
45 last if $_ eq "###\n";
49 open (OUT, '> out.tmp') or die "Cannot create out.tmp: $!\n";
50 $parser->parse_from_file ('tmp.pod', \*OUT);
52 open (TMP, 'out.tmp') or die "Cannot open out.tmp: $!\n";
59 unlink ('tmp.pod', 'out.tmp');
62 last if $_ eq "###\n";
65 if ($output eq $expected) {
69 print "Expected\n========\n$expected\nOutput\n======\n$output\n";
74 # Below the marker are bits of POD and corresponding expected output. This is
75 # used to test specific features or problems with Pod::Text::Termcap. The
76 # input and output are separated by lines containing only ###.
83 B<I<Do>> I<B<not>> B<I<include>> B<I<formatting codes when>> B<I<wrapping>>.
86 \e[1m
\e[33mDo
\e[0m
\e[0m
\e[33m
\e[1mnot
\e[0m
\e[0m
\e[1m
\e[33minclude
\e[0m
\e[0m
\e[1m
\e[33mformatting codes when
\e[0m
\e[0m
\e[1m
\e[33mwrapping
\e[0m
\e[0m.