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