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
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;
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.
+
+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
--- /dev/null
+#!/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";
+
+
--- /dev/null
+#!/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";
+
+
-#!./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
$| = 1;
-my $testcount = "1..";
-$testcount .= @tests/2;
-print "$testcount\n";
+print "1..";
+print @tests/2;
+print "\n";
use Text::Tabs;
-#!./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
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
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);
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]);
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);
} 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 {