X-Git-Url: http://git.maemo.org/git/?p=dh-make-perl;a=blobdiff_plain;f=dev%2Fi386%2Flibpod-simple-perl%2Flibpod-simple-perl-3.07%2Ft%2Fbasic.t;fp=dev%2Fi386%2Flibpod-simple-perl%2Flibpod-simple-perl-3.07%2Ft%2Fbasic.t;h=0b9cefd361199fc960824ae83bbb2ae7e19546ef;hp=0000000000000000000000000000000000000000;hb=8977e561d8a9eae6959218b0306c9df2056a38a9;hpb=df794b845212301ea0d267c919232538bfef356a diff --git a/dev/i386/libpod-simple-perl/libpod-simple-perl-3.07/t/basic.t b/dev/i386/libpod-simple-perl/libpod-simple-perl-3.07/t/basic.t new file mode 100644 index 0000000..0b9cefd --- /dev/null +++ b/dev/i386/libpod-simple-perl/libpod-simple-perl-3.07/t/basic.t @@ -0,0 +1,95 @@ +BEGIN { + if($ENV{PERL_CORE}) { + chdir 't'; + @INC = '../lib'; + } +} + +use strict; +use Test; +BEGIN { plan tests => 30 }; + +#use Pod::Simple::Debug (6); + +ok 1; + +require Pod::Simple::BlackBox; +ok 1; + +require Pod::Simple; ok 1; + +Pod::Simple->VERSION(.90); ok 1; + +#print "# Pod::Simple version $Pod::Simple::VERSION\n"; + +require Pod::Simple::DumpAsXML; ok 1; + +require Pod::Simple::XMLOutStream; ok 1; + +sub e ($$) { Pod::Simple::DumpAsXML->_duo(@_) } + +print "# Simple identity tests...\n"; + +&ok( e "", "" ); +&ok( e "\n", "", ); +&ok( e "\n", "\n", ); +&ok( e "puppies\n\n\n\n", "", ); + + +print "# Contentful identity tests...\n"; + +&ok( e "=pod\n\nFoo\n", "=pod\n\nFoo\n" ); +&ok( e "=pod\n\n\n\nFoo\n\n\n", "=pod\n\n\n\nFoo\n\n\n" ); +&ok( e "=pod\n\n\n\nFoo\n\n\n", "=pod\n\nFoo\n" ); + +# Now with some more newlines +&ok( e "\n\n=pod\n\nFoo\n", "\n\n=pod\n\nFoo\n" ); +&ok( e "=pod\n\n\n\nFoo\n\n\n", "=pod\n\n\n\nFoo\n\n\n" ); +&ok( e "=pod\n\n\n\nFoo\n\n\n", "\n\n=pod\n\nFoo\n" ); + + +&ok( e "=head1 Foo\n", "=head1 Foo\n" ); +&ok( e "=head1 Foo\n\n=cut\n", "=head1 Foo\n\n=cut\n" ); +&ok( e "=head1 Foo\n\n=cut\n", "=head1 Foo\n" ); + +# Now just add some newlines... +&ok( e "\n\n\n\n=head1 Foo\n", "\n\n\n\n=head1 Foo\n" ); +&ok( e "=head1 Foo\n\n=cut\n", "=head1 Foo\n\n=cut\n" ); +&ok( e "=head1 Foo\n\n=cut\n", "\n\n\n\n=head1 Foo\n" ); + + +print "# Simple XMLification tests...\n"; + +ok( Pod::Simple::XMLOutStream->_out("\n\n\nprint \$^T;\n\n\n"), + qq{} + # make sure the contentless flag is set +); +ok( Pod::Simple::XMLOutStream->_out("\n\n"), + qq{} + # make sure the contentless flag is set +); +ok( Pod::Simple::XMLOutStream->_out("\n"), + qq{} + # make sure the contentless flag is set +); +ok( Pod::Simple::XMLOutStream->_out(""), + qq{} + # make sure the contentless flag is set +); + +ok( Pod::Simple::XMLOutStream->_out('', '' ) ); + +ok( Pod::Simple::XMLOutStream->_out("=pod\n\nFoo\n"), + 'Foo' +); + +ok( Pod::Simple::XMLOutStream->_out("=head1 Chacha\n\nFoo\n"), + 'ChachaFoo' +); + + +print "# Wrapping up... one for the road...\n"; +ok 1; +print "# --- Done with ", __FILE__, " --- \n"; + +