Commit | Line | Data |
351625bd |
1 | BEGIN { |
2 | if($ENV{PERL_CORE}) { |
3 | chdir 't'; |
4 | @INC = '../lib'; |
5 | } |
6 | } |
7 | |
8 | use strict; |
9 | use Test; |
10 | BEGIN { plan tests => 4 }; |
11 | |
12 | #use Pod::Simple::Debug (5); |
13 | |
14 | ok 1; |
15 | |
16 | use Pod::Simple::DumpAsXML; |
17 | use Pod::Simple::XMLOutStream; |
18 | print "# Pod::Simple version $Pod::Simple::VERSION\n"; |
19 | |
20 | { |
21 | my @output_lines = split m/[\cm\cj]+/, Pod::Simple::XMLOutStream->_out( q{ |
22 | |
23 | =encoding koi8-r |
24 | |
25 | =head1 NAME |
26 | |
27 | ëÏÇÄÁ ÞÉÔÁÌÁ ÔÙ ÍÕÞÉÔÅÌØÎÙÅ ÓÔÒÏËÉ -- Fet's "When you were reading" |
28 | |
29 | =cut |
30 | |
31 | } ); |
32 | |
33 | |
34 | if(grep m/Unknown directive/i, @output_lines ) { |
35 | ok 0; |
36 | print "# I saw an Unknown directive warning here! :\n", |
37 | map("#==> $_\n", @output_lines), "#\n#\n"; |
38 | } else { |
39 | ok 1; |
40 | } |
41 | |
42 | } |
43 | |
44 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
45 | print "# Now a control group, to make sure that =fishbladder DOES\n", |
46 | "# cause an 'unknown directive' error...\n"; |
47 | |
48 | { |
49 | my @output_lines = split m/[\cm\cj]+/, Pod::Simple::XMLOutStream->_out( q{ |
50 | |
51 | =fishbladder |
52 | |
53 | =head1 NAME |
54 | |
55 | Fet's "When you were reading" |
56 | |
57 | =cut |
58 | |
59 | } ); |
60 | |
61 | |
62 | if(grep m/Unknown directive/i, @output_lines ) { |
63 | ok 1; |
64 | } else { |
65 | ok 0; |
66 | print "# But I didn't see an Unknows directive warning here! :\n", |
67 | map("#==> $_\n", @output_lines), "#\n#\n"; |
68 | } |
69 | |
70 | } |
71 | |
72 | |
73 | |
74 | print "#\n# And one for the road...\n"; |
75 | ok 1; |
76 | |