Change 34999 by [EMAIL PROTECTED] on 2008/12/03 22:37:52

        Integrate:
        [ 34000]
        Upgrade to Pod-Simple-3.07
        
        [ 34003]
        This needs to change so this doesn't need updating everytime
        we update Pod::Simple.
        
        [ 34004]
        Subject: [PATCH] incorrectly failing test in lib/Pod/t/text.t
        From: Hans Dieter Pearcey <[EMAIL PROTECTED]>
        Date: Thu, 5 Jun 2008 12:38:38 -0400
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/maint-5.10/perl/lib/Pod/Simple.pm#3 integrate
... //depot/maint-5.10/perl/lib/Pod/Simple/XHTML.pm#2 integrate
... //depot/maint-5.10/perl/lib/Pod/Simple/t/xhtml01.t#2 integrate
... //depot/maint-5.10/perl/lib/Pod/t/text.t#3 integrate

Differences ...

==== //depot/maint-5.10/perl/lib/Pod/Simple.pm#3 (text) ====
Index: perl/lib/Pod/Simple.pm
--- perl/lib/Pod/Simple.pm#2~34998~     2008-12-03 14:35:39.000000000 -0800
+++ perl/lib/Pod/Simple.pm      2008-12-03 14:37:52.000000000 -0800
@@ -18,7 +18,7 @@
 );
 
 @ISA = ('Pod::Simple::BlackBox');
-$VERSION = '3.06';
+$VERSION = '3.07';
 
 @Known_formatting_codes = qw(I B C L E F S X Z); 
 %Known_formatting_codes = map(($_=>1), @Known_formatting_codes);

==== //depot/maint-5.10/perl/lib/Pod/Simple/XHTML.pm#2 (text) ====
Index: perl/lib/Pod/Simple/XHTML.pm
--- perl/lib/Pod/Simple/XHTML.pm#1~34998~       2008-12-03 14:35:39.000000000 
-0800
+++ perl/lib/Pod/Simple/XHTML.pm        2008-12-03 14:37:52.000000000 -0800
@@ -27,13 +27,31 @@
 
 package Pod::Simple::XHTML;
 use strict;
-use vars qw( $VERSION @ISA );
+use vars qw( $VERSION @ISA $HAS_HTML_ENTITIES );
 $VERSION = '3.04';
 use Carp ();
 use Pod::Simple::Methody ();
 @ISA = ('Pod::Simple::Methody');
 
-use HTML::Entities 'encode_entities';
+BEGIN {
+  $HAS_HTML_ENTITIES = eval "require HTML::Entities; 1";
+}
+
+my %entities = (
+  q{>} => 'gt',
+  q{<} => 'lt',
+  q{'} => '#39',
+  q{"} => 'quot',
+  q{&} => 'amp',
+);
+
+sub encode_entities {
+  return HTML::Entities::encode_entities( $_[0] ) if $HAS_HTML_ENTITIES;
+  my $str = $_[0];
+  my $ents = join '', keys %entities;
+  $str =~ s/([$ents])/'&' . $entities{$1} . ';'/ge;
+  return $str;
+}
 
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

==== //depot/maint-5.10/perl/lib/Pod/Simple/t/xhtml01.t#2 (text) ====
Index: perl/lib/Pod/Simple/t/xhtml01.t
--- perl/lib/Pod/Simple/t/xhtml01.t#1~34998~    2008-12-03 14:35:39.000000000 
-0800
+++ perl/lib/Pod/Simple/t/xhtml01.t     2008-12-03 14:37:52.000000000 -0800
@@ -8,7 +8,7 @@
 
 use strict;
 use lib '../lib';
-use Test::More tests => 25;
+use Test::More tests => 26;
 
 use_ok('Pod::Simple::XHTML') or exit;
 
@@ -318,8 +318,13 @@
 
 EOHTML
 
-initialize($parser, $results);
-$parser->parse_string_document(<<'EOPOD');
+SKIP: for my $use_html_entities (0, 1) {
+  if ($use_html_entities and not $Pod::Simple::XHTML::HAS_HTML_ENTITIES) {
+    skip("HTML::Entities not installed", 1);
+  }
+  local $Pod::Simple::XHTML::HAS_HTML_ENTITIES = $use_html_entities;
+  initialize($parser, $results);
+  $parser->parse_string_document(<<'EOPOD');
 =pod
 
   # this header is very important & don't you forget it
@@ -332,6 +337,7 @@
   my \$text = &quot;File is: &quot; . &lt;FILE&gt;;</code></pre>
 
 EOHTML
+}
 
 ######################################
 

==== //depot/maint-5.10/perl/lib/Pod/t/text.t#3 (text) ====
Index: perl/lib/Pod/t/text.t
--- perl/lib/Pod/t/text.t#2~34998~      2008-12-03 14:35:39.000000000 -0800
+++ perl/lib/Pod/t/text.t       2008-12-03 14:37:52.000000000 -0800
@@ -57,8 +57,6 @@
     }
     if ($output eq $expected) {
         print "ok $n\n";
-    } elsif ($n == 4 && $Pod::Simple::VERSION < 3.07) {
-        print "ok $n # skip Pod::Simple S<> parsing bug\n";
     } else {
         print "not ok $n\n";
         print "Expected\n========\n$expected\nOutput\n======\n$output\n";
@@ -99,5 +97,6 @@
 ###
 Test of S<>
     This is some    whitespace.
+
 ###
 ==
End of Patch.

Reply via email to