~ubuntu-branches/ubuntu/jaunty/horae/jaunty

« back to all changes in this revision

Viewing changes to 0CPAN/Pod-Simple-3.03/t/basic.t

  • Committer: Bazaar Package Importer
  • Author(s): Carlo Segre
  • Date: 2008-02-23 23:13:02 UTC
  • mfrom: (2.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080223231302-mnyyxs3icvrus4ke
Tags: 066-3
Apply patch to athena_parts/misc.pl for compatibility with 
perl-tk 804.28.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
use strict;
3
 
use Test;
4
 
BEGIN { plan tests => 30 };
5
 
 
6
 
#use Pod::Simple::Debug (6);
7
 
 
8
 
ok 1;
9
 
 
10
 
require Pod::Simple::BlackBox;
11
 
ok 1;
12
 
 
13
 
require Pod::Simple; ok 1;
14
 
 
15
 
Pod::Simple->VERSION(.90); ok 1;
16
 
 
17
 
#print "# Pod::Simple version $Pod::Simple::VERSION\n";
18
 
 
19
 
require Pod::Simple::DumpAsXML; ok 1;
20
 
 
21
 
require Pod::Simple::XMLOutStream; ok 1;
22
 
 
23
 
sub e ($$) { Pod::Simple::DumpAsXML->_duo(@_) }
24
 
 
25
 
print "# Simple identity tests...\n";
26
 
 
27
 
&ok( e "", "" );
28
 
&ok( e "\n", "", );
29
 
&ok( e "\n", "\n", );
30
 
&ok( e "puppies\n\n\n\n", "", );
31
 
 
32
 
 
33
 
print "# Contentful identity tests...\n";
34
 
 
35
 
&ok( e "=pod\n\nFoo\n",         "=pod\n\nFoo\n"         );
36
 
&ok( e "=pod\n\n\n\nFoo\n\n\n", "=pod\n\n\n\nFoo\n\n\n" );
37
 
&ok( e "=pod\n\n\n\nFoo\n\n\n", "=pod\n\nFoo\n"         );
38
 
 
39
 
# Now with some more newlines
40
 
&ok( e "\n\n=pod\n\nFoo\n",     "\n\n=pod\n\nFoo\n"     );
41
 
&ok( e "=pod\n\n\n\nFoo\n\n\n", "=pod\n\n\n\nFoo\n\n\n" );
42
 
&ok( e "=pod\n\n\n\nFoo\n\n\n", "\n\n=pod\n\nFoo\n"     );
43
 
 
44
 
 
45
 
&ok( e "=head1 Foo\n",          "=head1 Foo\n"          );
46
 
&ok( e "=head1 Foo\n\n=cut\n",  "=head1 Foo\n\n=cut\n"  );
47
 
&ok( e "=head1 Foo\n\n=cut\n",  "=head1 Foo\n"          );
48
 
 
49
 
# Now just add some newlines...
50
 
&ok( e "\n\n\n\n=head1 Foo\n",  "\n\n\n\n=head1 Foo\n"  );
51
 
&ok( e "=head1 Foo\n\n=cut\n",  "=head1 Foo\n\n=cut\n"  );
52
 
&ok( e "=head1 Foo\n\n=cut\n",  "\n\n\n\n=head1 Foo\n"  );
53
 
 
54
 
 
55
 
print "# Simple XMLification tests...\n";
56
 
 
57
 
ok( Pod::Simple::XMLOutStream->_out("\n\n\nprint \$^T;\n\n\n"),
58
 
    qq{<Document\ncontentless="1"></Document>}
59
 
     # make sure the contentless flag is set
60
 
);
61
 
ok( Pod::Simple::XMLOutStream->_out("\n\n"),
62
 
    qq{<Document\ncontentless="1"></Document>}
63
 
     # make sure the contentless flag is set
64
 
);
65
 
ok( Pod::Simple::XMLOutStream->_out("\n"),
66
 
    qq{<Document\ncontentless="1"></Document>}
67
 
     # make sure the contentless flag is set
68
 
);
69
 
ok( Pod::Simple::XMLOutStream->_out(""),
70
 
    qq{<Document\ncontentless="1"></Document>}
71
 
     # make sure the contentless flag is set
72
 
);
73
 
 
74
 
ok( Pod::Simple::XMLOutStream->_out('', '<Document></Document>' ) );
75
 
 
76
 
ok( Pod::Simple::XMLOutStream->_out("=pod\n\nFoo\n"),
77
 
    '<Document><Para>Foo</Para></Document>'
78
 
);
79
 
 
80
 
ok( Pod::Simple::XMLOutStream->_out("=head1 Chacha\n\nFoo\n"),
81
 
    '<Document><head1>Chacha</head1><Para>Foo</Para></Document>'
82
 
);
83
 
 
84
 
 
85
 
print "# Wrapping up... one for the road...\n";
86
 
ok 1;
87
 
print "# --- Done with ", __FILE__, " --- \n";
88
 
 
89