~ubuntu-branches/ubuntu/intrepid/horae/intrepid

« back to all changes in this revision

Viewing changes to 0CPAN/Pod-Simple-3.03/t/heads.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 => 19 };
5
 
 
6
 
#use Pod::Simple::Debug (6);
7
 
 
8
 
ok 1;
9
 
 
10
 
use Pod::Simple::DumpAsXML;
11
 
use Pod::Simple::XMLOutStream;
12
 
print "# Pod::Simple version $Pod::Simple::VERSION\n";
13
 
sub e ($$) { Pod::Simple::DumpAsXML->_duo(@_) }
14
 
 
15
 
 
16
 
print "# Simple tests for head1 - head4...\n";
17
 
ok( Pod::Simple::XMLOutStream->_out("\n=head1 Chacha\n\n"),
18
 
    '<Document><head1>Chacha</head1></Document>'
19
 
);
20
 
ok( Pod::Simple::XMLOutStream->_out("\n=head2 Chacha\n\n"),
21
 
    '<Document><head2>Chacha</head2></Document>'
22
 
);
23
 
ok( Pod::Simple::XMLOutStream->_out("\n=head3 Chacha\n\n"),
24
 
    '<Document><head3>Chacha</head3></Document>'
25
 
);
26
 
ok( Pod::Simple::XMLOutStream->_out("\n=head4 Chacha\n\n"),
27
 
    '<Document><head4>Chacha</head4></Document>'
28
 
);
29
 
 
30
 
print "# Testing whitespace equivalence...\n";
31
 
 
32
 
&ok(e "\n=head1 Chacha\n\n", "\n=head1       Chacha\n\n");
33
 
&ok(e "\n=head1 Chacha\n\n", "\n=head1\tChacha\n\n");
34
 
&ok(e "\n=head1 Chacha\n\n", "\n=head1\tChacha      \n\n");
35
 
 
36
 
 
37
 
 
38
 
ok( Pod::Simple::XMLOutStream->_out("=head1     Chachacha"),
39
 
    '<Document><head1>Chachacha</head1></Document>'
40
 
);
41
 
 
42
 
 
43
 
print "# Testing whitespace variance ...\n";
44
 
ok( Pod::Simple::XMLOutStream->_out("=head1     Cha cha cha   \n"),
45
 
    '<Document><head1>Cha cha cha</head1></Document>'
46
 
);
47
 
ok( Pod::Simple::XMLOutStream->_out("=head1     Cha   cha\tcha   \n"),
48
 
    '<Document><head1>Cha cha cha</head1></Document>'
49
 
);
50
 
 
51
 
 
52
 
 
53
 
 
54
 
print "# Testing head2, head3, head4 more...\n";
55
 
 
56
 
ok( Pod::Simple::XMLOutStream->_out("=head2     Cha   cha\tcha   \n"),
57
 
    '<Document><head2>Cha cha cha</head2></Document>'
58
 
);
59
 
ok( Pod::Simple::XMLOutStream->_out("=head3     Cha   cha\tcha   \n"),
60
 
    '<Document><head3>Cha cha cha</head3></Document>'
61
 
);
62
 
ok( Pod::Simple::XMLOutStream->_out("=head4     Cha   cha\tcha   \n"),
63
 
    '<Document><head4>Cha cha cha</head4></Document>'
64
 
);
65
 
 
66
 
print "# Testing entity expansion...\n";
67
 
 
68
 
ok( Pod::Simple::XMLOutStream->_out("=head4 fooE<64>bar!\n"),
69
 
    Pod::Simple::XMLOutStream->_out("\n=head4  foo\@bar!\n\n"),
70
 
);
71
 
 
72
 
# TODO: a mode so that DumpAsXML can ask for all contiguous string
73
 
#  sequences to be fused?
74
 
# &ok( e "=head4 fooE<64>bar!\n", "\n=head4  foo\@bar!\n\n");
75
 
 
76
 
print "# Testing formatting sequences...\n";
77
 
 
78
 
# True only if the sequences resolve, as they should...
79
 
&ok( e "=head4 C<foobar!>\n", "\n=head4 C<< foobar!    >>\n\n");
80
 
&ok( e "=head4 C<foobar!>\n", "\n\n=head4 C<<<  foobar! >>>\n");
81
 
&ok( e "=head4 C<foobar!>\n", "\n=head4 C<< foobar!\n\t>>\n\n");
82
 
 
83
 
print "# Wrapping up... one for the road...\n";
84
 
ok 1;
85
 
print "# --- Done with ", __FILE__, " --- \n";
86