Update Text::Tabs and Text::Wrap to version 2006.1117
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 20 Nov 2006 09:54:10 +0000 (09:54 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 20 Nov 2006 09:54:10 +0000 (09:54 +0000)
p4raw-id: //depot/perl@29320

MANIFEST
lib/Text/Tabs.pm
lib/Text/TabsWrap/CHANGELOG
lib/Text/TabsWrap/t/Jacobson.t [new file with mode: 0644]
lib/Text/TabsWrap/t/Jacobson2.t [new file with mode: 0644]
lib/Text/TabsWrap/t/tabs.t
lib/Text/TabsWrap/t/wrap.t
lib/Text/Wrap.pm

index e6a087b..871e4da 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -2530,6 +2530,8 @@ lib/Text/TabsWrap/t/37000.t       See if Text::Tabs is working
 lib/Text/TabsWrap/t/39548.t    See if Text::Tabs is working
 lib/Text/TabsWrap/t/belg4mit.t See if Text::Tabs is working
 lib/Text/TabsWrap/t/fill.t     See if Text::Wrap::fill works
+lib/Text/TabsWrap/t/Jacobson.t See if Text::Tabs is working
+lib/Text/TabsWrap/t/Jacobson2.t        See if Text::Tabs is working
 lib/Text/TabsWrap/t/Jochen.t   See if Text::Tabs is working
 lib/Text/TabsWrap/t/sep2.t     See if Text::Tabs is working
 lib/Text/TabsWrap/t/sep.t      See if Text::Tabs is working
index ab54c77..610e870 100644 (file)
@@ -3,11 +3,11 @@ package Text::Tabs;
 
 require Exporter;
 
-@ISA = qw(Exporter);
+@ISA = (Exporter);
 @EXPORT = qw(expand unexpand $tabstop);
 
 use vars qw($VERSION $tabstop $debug);
-$VERSION = 2007.0711_01;
+$VERSION = 2007.1117;
 
 use strict;
 
@@ -127,11 +127,6 @@ Instead of the C<unexpand -a> command, use:
 
   perl -MText::Tabs -n -e 'print unexpand $_'
 
-=head1 BUGS
-
-expand doesn't handle newlines very quickly -- do not feed it an
-entire document in one string.  Instead feed it an array of lines.
-
 =head1 LICENSE
 
 Copyright (C) 1996-2002,2005,2006 David Muir Sharnoff.  
index f82e584..8d4171e 100644 (file)
@@ -1,3 +1,12 @@
+
+Use warnings::warnif instead of just warn for columns < 2.  Appled per
+request of Rafael Garcia-Suarez <rgarciasuarez at gmail.com>.
+
+= 2006/11/17
+
+Text::Tabs can handle newlines now so the BUGS section has been removed
+per request from Aristotle Pagaltzis.
+
 = 2006/07/11
 
 Further bomb-proofing to pass more tests: Dan Jacobson <jidanni at 
diff --git a/lib/Text/TabsWrap/t/Jacobson.t b/lib/Text/TabsWrap/t/Jacobson.t
new file mode 100644 (file)
index 0000000..22d42e4
--- /dev/null
@@ -0,0 +1,24 @@
+#!/usr/bin/perl -I.
+
+# From: Dan Jacobson <jidanni at jidanni dot org>
+
+use Text::Wrap qw(wrap $columns $huge $break);
+
+print "1..1\n";
+
+$huge='overflow';
+$Text::Wrap::columns=9;
+$break="(?<=[,.])";
+eval {
+$a=wrap('','',
+"mmmm,n,ooo,ppp.qqqq.rrrrr,sssssssssssss,ttttttttt,uu,vvv wwwwwwwww####\n");
+};
+
+if ($@) {
+       my $e = $@;
+       $e =~ s/^/# /gm;
+       print $e;
+}
+print $@ ? "not ok 1\n" : "ok 1\n";
+
+
diff --git a/lib/Text/TabsWrap/t/Jacobson2.t b/lib/Text/TabsWrap/t/Jacobson2.t
new file mode 100644 (file)
index 0000000..5874e0e
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/perl -I.
+
+use Text::Wrap qw(wrap $columns $huge $break);
+
+print "1..1\n";
+
+$huge='overflow';
+$Text::Wrap::columns=9;
+$break="(?<=[,.])";
+eval {
+$a=wrap('','',
+"mmmm,n,ooo,ppp.qqqq.rrrrr.adsljasdf\nlasjdflajsdflajsdfljasdfl\nlasjdflasjdflasf,sssssssssssss,ttttttttt,uu,vvv wwwwwwwww####\n");
+};
+
+if ($@) {
+       my $e = $@;
+       $e =~ s/^/# /gm;
+       print $e;
+}
+print $@ ? "not ok 1\n" : "ok 1\n";
+
+
index 2856aff..1bba9a6 100755 (executable)
@@ -1,9 +1,4 @@
-#!./perl -w
-
-BEGIN {
-    chdir 't' if -d 't';
-    @INC = '../lib';
-}
+#!/usr/old/bin/perl5.004_01 -w
 
 @tests = (split(/\nEND\n/s, <<DONE));
 TEST 1 u
@@ -91,9 +86,9 @@ DONE
 
 $| = 1;
 
-my $testcount = "1..";
-$testcount .= @tests/2;
-print "$testcount\n";
+print "1..";
+print @tests/2;
+print "\n";
 
 use Text::Tabs;
 
index 8ff4217..37ffbb5 100755 (executable)
@@ -1,11 +1,6 @@
-#!./perl -w
+#!/usr/bin/perl5.00502
 
-BEGIN {
-    chdir 't' if -d 't';
-    @INC = '../lib';
-}
-
-@tests = (split(/\nEND\n/s, <<'DONE'));
+@tests = (split(/\nEND\n/s, <<DONE));
 TEST1
 This 
 is
@@ -117,17 +112,6 @@ END
  Lines
 
 END
-TEST13 break=\d
-I saw 3 ships come sailing in
-END
-   I saw 3 ships come sailing in
-END
-TEST14 break=\d
-the.quick.brown.fox.jumps.over.the.9.lazy.dogs.for.no.good.reason.whatsoever.apparently
-END
-   the.quick.brown.fox.jumps.over.the.
- .lazy.dogs.for.no.good.reason.whatsoever.apparently
-END
 DONE
 
 
@@ -146,9 +130,7 @@ while (@st) {
        my $in = shift(@st);
        my $out = shift(@st);
 
-       $in =~ s/^TEST(\d+)( break=(.*))?\n//
-           or die "bad TEST header line: $in\n";
-       local $Text::Wrap::break = $3 if defined $3;
+       $in =~ s/^TEST(\d+)?\n//;
 
        my $back = wrap('   ', ' ', $in);
 
@@ -182,10 +164,7 @@ while(@st) {
        my $in = shift(@st);
        my $out = shift(@st);
 
-       $in =~ s/^TEST(\d+)( break=(.*))?\n//
-           or die "bad TEST header line: $in\n";
-       local $Text::Wrap::break = $3 if defined $3;
-
+       $in =~ s/^TEST(\d+)?\n//;
 
        my @in = split("\n", $in, -1);
        @in = ((map { "$_\n" } @in[0..$#in-1]), $in[-1]);
index b0e15a7..4d2b8e8 100644 (file)
@@ -1,12 +1,13 @@
 package Text::Wrap;
 
+use warnings::register;
 require Exporter;
 
 @ISA = qw(Exporter);
 @EXPORT = qw(wrap fill);
 @EXPORT_OK = qw($columns $break $huge);
 
-$VERSION = 2006.0711;
+$VERSION = 2006.1117;
 
 use vars qw($VERSION $columns $debug $break $huge $unexpand $tabstop
        $separator $separator2);
@@ -62,7 +63,7 @@ sub wrap
                } elsif ($huge eq 'die') {
                        die "couldn't wrap '$t'";
                } elsif ($columns < 2) {
-                       warn "Increasing \$Text::Wrap::columns from $columns to 2";
+                       warnings::warnif "Increasing \$Text::Wrap::columns from $columns to 2";
                        $columns = 2;
                        return ($ip, $xp, @t);
                } else {