#! /usr/bin/perl # #=============================================================================== # # FILE: bugs.t # # DESCRIPTION: Codings that caused problems in the past, but no more :-) # # FILES: --- # BUGS: --- # NOTES: --- # AUTHOR: Geoffrey Leach, # VERSION: 1.0 # CREATED: 12/19/07 13:45:55 PST # REVISION: --- #=============================================================================== use 5.006002; use strict; use warnings; use lib qw(./t); use Run qw( run ); use Pod::HtmlEasy::Data qw( NL ); use version; our $VERSION = qv('1.0'); #--------------------------- test 4 run(q{URL in verbatum text}, [ q{=item URL in verbatum text}, q{Leading non-verbatum}, q{ http://www.somewhere.com}, q{trailing non-verbatum}, ], [ q{
  • URL in verbatum text
  • }, q{

    Leading non-verbatum

    }, q{
        www.somewhere.com
    }, q{

    trailing non-verbatum

    }, ], ); #--------------------------- test 5 run(q{Multiple MARK_FILTER IDs}, [ # Example of how to handle multi-line paragraphs q{=item Multiple MARK_FILTER IDs}, q{The following used to confuse due to multiple MARK_FILTER instances } . q{with the same ID.}, q{}, q{Remember that if the connection is } . q{Ckeepalive|docs::2.0::api::Apache2::Connection/C_keepalive_>> } . q{and the connection filter is removed, it won't be added until the } . q{connection is closed. Which may happen after many HTTP requests. You } . q{may want to keep the filter in place and pass the data through } . q{unmodified, by returning C. } . q{If you need to reset the } . q{whole or parts of the filter context between requests, use the } . q{Lkeepalives> counting|} . q{docs::2.0::user::handler::filters>.}, ], [ q{
  • } . q{Multiple MARK_FILTER IDs
  • }, q{

    The following used to confuse due to multiple MARK_FILTER instances } . q{with the same ID.

    }, q{

    Remember that if the connection is } . q{} . q{>keepalive } . q{and the connection filter is removed, it won't be added until the } . q{connection is closed. Which may happen after many HTTP requests. You } . q{may want to keep the filter in place and pass the data through } . q{unmodified, by returning } . q{Apache2::Const::DECLINED. } . q{If you need to reset the } . q{whole or parts of the filter context between requests, use the } . q{technique } . q{based on } . q{$c->keepalives counting.

    }, ], ); #--------------------------- test 6 run(q{Trailing verbatim}, [ q{=item Trailing verbatim}, q{ This used to be ignored.}, ], [ q{
  • Trailing verbatim
  • }, q{
        This used to be ignored.
    }, ], ); #--------------------------- test 7 run(q{Unsupported URIs}, [ q{=item Unsupported URIs}, q{L}, q{L}, q{L}, q{L}, q{L}, ], [ q{
  • Unsupported URIs
  • }, q{

    fax:+358.555.1234567

    }, q{

    tel:+358-555-1234567

    }, q{

    modem:+3585551234567;type=v32b?7e1;} . q{type=v110

    }, q{

    tel:0w003585551234567;phone-context=+3585551234

    }, q{

    tel:+1234567890;phone-context=+1234;vnd.company.option=foo

    }, ], ); #--------------------------- test 8 run(q{Special cases of verbatim}, [ q{=item Special cases of verbatim}, q{=item C<< $thing->stuff(I) >>)}, q{ That's what I think!} . NL . q{ What's C for?} . NL . q{ X and C Under Different Operating Systems>} . NL . q{ C } . NL . q{ C<< thing >> } . NL . q{ C<< thing >> } . NL . q{ C<<< thing >>> } . NL . q{ C<<<< } . NL . q{ thing } . NL . q{ >>>> }, ], [ q{
  • } . q{Special cases of verbatim
  • }, q{
  • } . q{$thing->stuff(dodad))
  • }, q{
     That's what I<you> think!} 
                . NL
                . q{ What's C<dump()> for?}
                . NL
                . q{ X<C<chmod> and C<unlink()> }
                . q{Under Different Operating Systems>}
                . NL
                . q{ C<thing> }
                . NL
                . q{ C<< thing >> }
                . NL
                . q{ C<<           thing     >> }
                . NL
                . q{ C<<<   thing >>> }
                . NL
                . q{ C<<<< }
                . NL
                . q{ thing }
                . NL
                . q{        >>>> 
    }, ], ); #--------------------------- test 9 run(q{on_S improper call}, [ q{=item on_S improper call}, q{The C<:ATTR> marker can also be given a number of options which automate } . NL . q{other attribute-related behaviours. Each of these options consists of a } . NL . q{key/value pair, which may be specified in either Perl 5 "fat comma" syntax } . NL . q{( C<< S<< key => 'value' >> >> ) or in one of the Perl 6 option syntaxes } . NL . q{( C<< S<< :key >> >> or C<< S<< :key('value') >> >> or } . NL . q{C<< S<< :key«value» >> >>).}, ], [ # Note no extra space at the line ends q{
  • on_S improper call
  • }, q{

    The :ATTR marker can also } . q{be given a number of options which automate} . NL . q{other attribute-related behaviours. Each of these options consists of a} . NL . q{key/value pair, which may be specified in either Perl 5 } . q{"fat comma" syntax} . NL . q{( key => 'value' ) } . q{or in one of the Perl 6 option syntaxes} . NL . q{( :key or } . q{:key('value') or} . NL . q{:key«value»).

    }, ], ); #--------------------------- test 10 run(q{Apache2 unusual content}, [ q{=head1 NAME}, q{}, q{Apache2::Filter & Extra Stuff}, q{}, q{}, q{This is the NAME content, with extra blank lines.} . NL . q{The '&' caused problems.}, ], [ q{

    NAME

    }, q{

    Apache2::Filter & Extra Stuff

    }, q{

    This is the NAME content, with extra blank lines.} . NL . q{The '&' caused problems.

    }, ], [ q{
  • NAME
  • }, ], { title => q{Apache2::Filter & Extra Stuff}, no_css => 1, no_generator => 1, }, ); #--------------------------- test 11 run(q{Indexed item with tabs}, [ q{=item testing testing}, q{This is the item}, ], [ q{
  • testing testing
  • }, q{

    This is the item

    }, ], [ q{}, ], { title => q{Indexed item with tabs}, no_css => 1, index_item => 1, no_generator => 1, }, ); #--------------------------- test 12 # Workaround for "dispute" between Regexp::Common and Spamassassin PODs run(q{URL with embedded %2E}, [ q{http://spamassassin.apache%2Eorg/}, ], [ q{

    } . q{spamassassin.apache.org

    } ], ); 1; #--------------------------- test 13 run(q{L<> embedded reference}, [ q{We're searching for L somewhere else.}, q{=head1 this reference}, ], [ q{

    We're searching for "this reference" } . q{somewhere else.

    }, q{

    this reference

    }, ], [ q{
  • this reference
  • }, ], { no_css => 1, index_item => 1, no_generator => 1, }, ); #--------------------------- test 14 run(q{L<>, http in =item}, [ q{=item L}, q{=item http://www.foo.bar.com}, ], [ q{
  • } . q{www.xxx.bar.com
  • }, q{
  • } . q{www.foo.bar.com
  • }, ], [ # Extra
      because we don't have an =head1 q{}, ], { no_css => 1, index_item => 1, no_generator => 1, }, ); #--------------------------- test 15 run(q{Empty L<>: error message is normal}, [ q{This is very bad: L<> ... or is it?}, ], [ q{}, q{

      This is very bad: ... or is it?

      }, ], undef, ); #--------------------------- test 16 run ( q{URL in parens, trailing ')'}, [ q{Here it (http://www.bipm.fr/enus/3_SI/si-prefixes.html) is}, ], # The paren should precede 'is' rather than being associated with 'html', # However fixing that in Parser.pm causes more severe problems. [ q{

      Here it (www.bipm.fr is

      }, ], [ ], { no_css => 1, index_item => 1, no_generator => 1, }, ); #--------------------------- test 17 run ( q{=begin/=end with no cmd}, [ q{=begin twas brillig}, q{This is foobar}, q{=end twas brillig}, q{This is barfoo}, ], [ q{

      This is foobar

      }, q{

      This is barfoo

      }, ], [ ], ); __END__ =cut # Write to file for testing # use lib qw(./t); use Run qw( run ); use Pod::HtmlEasy::Data qw( NL ); $ENV{DUMPHTML} = 1; # 19 lines from this point #--------------------------- test 13 run ( q{}, [ q{}, ], [ ], undef, [ ], undef, { }, );