This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Assimilate Pod-Simple-3.03 to the Perl core
[perl5.git] / lib / Pod / Simple / t / encoding_not_error.t
CommitLineData
351625bd
SP
1BEGIN {
2 if($ENV{PERL_CORE}) {
3 chdir 't';
4 @INC = '../lib';
5 }
6}
7
8use strict;
9use Test;
10BEGIN { plan tests => 4 };
11
12#use Pod::Simple::Debug (5);
13
14ok 1;
15
16use Pod::Simple::DumpAsXML;
17use Pod::Simple::XMLOutStream;
18print "# Pod::Simple version $Pod::Simple::VERSION\n";
19
20{
21my @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
34if(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# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
45print "# Now a control group, to make sure that =fishbladder DOES\n",
46 "# cause an 'unknown directive' error...\n";
47
48{
49my @output_lines = split m/[\cm\cj]+/, Pod::Simple::XMLOutStream->_out( q{
50
51=fishbladder
52
53=head1 NAME
54
55Fet's "When you were reading"
56
57=cut
58
59} );
60
61
62if(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
74print "#\n# And one for the road...\n";
75ok 1;
76