summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/t/lib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/perl5/t/lib')
-rwxr-xr-xcontrib/perl5/t/lib/cgi-html.t7
-rwxr-xr-xcontrib/perl5/t/lib/complex.t18
-rwxr-xr-xcontrib/perl5/t/lib/db-recno.t10
-rwxr-xr-xcontrib/perl5/t/lib/dumper.t207
-rwxr-xr-xcontrib/perl5/t/lib/fatal.t27
-rw-r--r--contrib/perl5/t/lib/h2ph.pht4
-rwxr-xr-xcontrib/perl5/t/lib/io_udp.t2
-rwxr-xr-xcontrib/perl5/t/lib/parsewords.t7
-rwxr-xr-xcontrib/perl5/t/lib/posix.t2
-rwxr-xr-xcontrib/perl5/t/lib/safe2.t12
-rwxr-xr-xcontrib/perl5/t/lib/searchdict.t38
-rwxr-xr-xcontrib/perl5/t/lib/textfill.t96
-rwxr-xr-xcontrib/perl5/t/lib/textwrap.t136
-rwxr-xr-xcontrib/perl5/t/lib/thread.t2
14 files changed, 483 insertions, 85 deletions
diff --git a/contrib/perl5/t/lib/cgi-html.t b/contrib/perl5/t/lib/cgi-html.t
index 16aa824..6a7ff1e 100755
--- a/contrib/perl5/t/lib/cgi-html.t
+++ b/contrib/perl5/t/lib/cgi-html.t
@@ -8,11 +8,11 @@ BEGIN {
@INC = '../lib' if -d '../lib';
}
-BEGIN {$| = 1; print "1..17\n"; }
+BEGIN {$| = 1; print "1..20\n"; }
BEGIN {$eol = $^O eq 'VMS' ? "\n" : "\cM\cJ";
$eol = "\r\n" if $^O eq 'os390'; }
END {print "not ok 1\n" unless $loaded;}
-use CGI (':standard','-no_debug');
+use CGI (':standard','-no_debug','*h3','start_table');
$loaded = 1;
print "ok 1\n";
@@ -64,3 +64,6 @@ test(16,($cookie=cookie(-name=>'fred',-value=>['chocolate','chip'],-path=>'/'))
'fred=chocolate&chip; path=/',"cookie()");
test(17,header(-Cookie=>$cookie) =~ m!^Set-Cookie: fred=chocolate&chip\; path=/${eol}Date:.*${eol}Content-Type: text/html${eol}${eol}!s,
"header(-cookie)");
+test(18,start_h3 eq '<H3>');
+test(19,end_h3 eq '</H3>');
+test(20,start_table({-border=>undef}) eq '<TABLE BORDER>');
diff --git a/contrib/perl5/t/lib/complex.t b/contrib/perl5/t/lib/complex.t
index 2bb14f0..c073f50 100755
--- a/contrib/perl5/t/lib/complex.t
+++ b/contrib/perl5/t/lib/complex.t
@@ -14,7 +14,7 @@ BEGIN {
use Math::Complex;
-$VERSION = sprintf("%s", q$Id: complex.t,v 1.8 1998/02/05 16:03:39 jhi Exp $ =~ /(\d+\.d+)/);
+my $VERSION = sprintf("%s", q$Id: complex.t,v 1.9 1998/11/01 00:00:00 dsl Exp $ =~ /(\d+\.d+)/);
my ($args, $op, $target, $test, $test_set, $try, $val, $zvalue, @set, @val);
@@ -173,20 +173,6 @@ test_loz(
'acoth(-1)',
);
-# test the 0**0
-
-sub test_ztz {
- $test++;
-
- push(@script, <<'EOT');
-eval 'cplx(0)**cplx(0)';
-print 'not ' unless ($@ =~ /zero raised to the zeroth/);
-EOT
- push(@script, qq(print "ok $test\\n";\n));
-}
-
-test_ztz;
-
# test the bad roots
sub test_broot {
@@ -387,6 +373,7 @@ __END__
(1,0):(2,3):(1,0)
(2,3):(0,0):(1,0)
(2,3):(1,0):(2,3)
+(0,0):(0,0):(1,0)
&Re
(3,4):3
@@ -876,4 +863,3 @@ __END__
( 2,-3):( 0.14694666622553, 0.23182380450040)
# eof
-
diff --git a/contrib/perl5/t/lib/db-recno.t b/contrib/perl5/t/lib/db-recno.t
index c89c3ca..da703c9 100755
--- a/contrib/perl5/t/lib/db-recno.t
+++ b/contrib/perl5/t/lib/db-recno.t
@@ -42,14 +42,16 @@ sub bad_one
{
print STDERR <<EOM unless $bad_ones++ ;
#
-# Some older versions of Berkeley DB will fail tests 51, 53 and 55.
+# Some older versions of Berkeley DB version 1 will fail tests 51,
+# 53 and 55.
#
# You can safely ignore the errors if you're never going to use the
-# broken functionality (recno databases with a modified bval).
+# broken functionality (recno databases with a modified bval).
# Otherwise you'll have to upgrade your DB library.
#
-# If you want to upgrade Berkeley DB, the most recent version is 1.85.
-# Check out http://www.bostic.com/db for more details.
+# If you want to use Berkeley DB version 1, then 1.85 and 1.86 are the
+# last versions that were released. Berkeley DB version 2 is continually
+# being updated -- Check out http://www.sleepycat.com/ for more details.
#
EOM
}
diff --git a/contrib/perl5/t/lib/dumper.t b/contrib/perl5/t/lib/dumper.t
index 70f8abe..8c8dc40 100755
--- a/contrib/perl5/t/lib/dumper.t
+++ b/contrib/perl5/t/lib/dumper.t
@@ -9,6 +9,8 @@ BEGIN {
}
use Data::Dumper;
+use Config;
+my $Is_ebcdic = defined($Config{'ebcdic'}) && $Config{'ebcdic'} eq 'define';
$Data::Dumper::Pad = "#";
my $TMAX;
@@ -35,11 +37,11 @@ sub TEST {
if (defined &Data::Dumper::Dumpxs) {
print "### XS extension loaded, will run XS tests\n";
- $TMAX = 138; $XS = 1;
+ $TMAX = 162; $XS = 1;
}
else {
print "### XS extensions not loaded, will NOT run XS tests\n";
- $TMAX = 69; $XS = 0;
+ $TMAX = 81; $XS = 0;
}
print "1..$TMAX\n";
@@ -234,13 +236,22 @@ EOT
############# 43
##
+if (!$Is_ebcdic) {
$WANT = <<'EOT';
#$VAR1 = {
-# "abc\000\efg" => "mno\000"
+# "abc\0'\efg" => "mno\0"
#};
EOT
+}
+else {
+$WANT = <<'EOT';
+#$VAR1 = {
+# "\201\202\203\340\360'\340\205\206\207" => "\224\225\226\340\360"
+#};
+EOT
+}
-$foo = { "abc\000\efg" => "mno\000" };
+$foo = { "abc\000\'\efg" => "mno\000" };
{
local $Data::Dumper::Useqq = 1;
TEST q(Dumper($foo));
@@ -248,7 +259,7 @@ $foo = { "abc\000\efg" => "mno\000" };
$WANT = <<"EOT";
#\$VAR1 = {
-# 'abc\000\efg' => 'mno\000'
+# 'abc\0\\'\efg' => 'mno\0'
#};
EOT
@@ -444,18 +455,34 @@ EOT
############# 85
##
+if (!$Is_ebcdic) {
$WANT = <<'EOT';
#%kennels = (
# First => \'Fido',
# Second => \'Wags'
#);
#@dogs = (
-# $kennels{First},
-# $kennels{Second},
+# ${$kennels{First}},
+# ${$kennels{Second}},
+# \%kennels
+#);
+#%mutts = %kennels;
+EOT
+}
+else {
+ $WANT = <<'EOT';
+#%kennels = (
+# Second => \'Wags',
+# First => \'Fido'
+#);
+#@dogs = (
+# ${$kennels{First}},
+# ${$kennels{Second}},
# \%kennels
#);
#%mutts = %kennels;
EOT
+}
TEST q(
$d = Data::Dumper->new([\\%kennel, \\@dogs, $mutts],
@@ -483,19 +510,34 @@ EOT
############# 97
##
+if (!$Is_ebcdic) {
$WANT = <<'EOT';
#%kennels = (
# First => \'Fido',
# Second => \'Wags'
#);
#@dogs = (
-# $kennels{First},
-# $kennels{Second},
+# ${$kennels{First}},
+# ${$kennels{Second}},
# \%kennels
#);
#%mutts = %kennels;
EOT
-
+}
+else {
+ $WANT = <<'EOT';
+#%kennels = (
+# Second => \'Wags',
+# First => \'Fido'
+#);
+#@dogs = (
+# ${$kennels{First}},
+# ${$kennels{Second}},
+# \%kennels
+#);
+#%mutts = %kennels;
+EOT
+}
TEST q($d->Reset; $d->Dump);
if ($XS) {
@@ -504,7 +546,8 @@ EOT
############# 103
##
- $WANT = <<'EOT';
+if (!$Is_ebcdic) {
+ $WANT = <<'EOT';
#@dogs = (
# 'Fido',
# 'Wags',
@@ -516,6 +559,21 @@ EOT
#%kennels = %{$dogs[2]};
#%mutts = %{$dogs[2]};
EOT
+}
+else {
+ $WANT = <<'EOT';
+#@dogs = (
+# 'Fido',
+# 'Wags',
+# {
+# Second => \$dogs[1],
+# First => \$dogs[0]
+# }
+#);
+#%kennels = %{$dogs[2]};
+#%mutts = %{$dogs[2]};
+EOT
+}
TEST q(
$d = Data::Dumper->new([\\@dogs, \\%kennel, $mutts],
@@ -539,6 +597,7 @@ EOT
############# 115
##
+if (!$Is_ebcdic) {
$WANT = <<'EOT';
#@dogs = (
# 'Fido',
@@ -553,6 +612,23 @@ EOT
# Second => \'Wags'
#);
EOT
+}
+else {
+ $WANT = <<'EOT';
+#@dogs = (
+# 'Fido',
+# 'Wags',
+# {
+# Second => \'Wags',
+# First => \'Fido'
+# }
+#);
+#%kennels = (
+# Second => \'Wags',
+# First => \'Fido'
+#);
+EOT
+}
TEST q(
$d = Data::Dumper->new( [\@dogs, \%kennel], [qw(*dogs *kennels)] );
@@ -566,8 +642,8 @@ EOT
{
-sub a { print "foo\n" }
-$c = [ \&a ];
+sub z { print "foo\n" }
+$c = [ \&z ];
############# 121
##
@@ -578,8 +654,8 @@ $c = [ \&a ];
#];
EOT
-TEST q(Data::Dumper->new([\&a,$c],['a','c'])->Seen({'b' => \&a})->Dump;);
-TEST q(Data::Dumper->new([\&a,$c],['a','c'])->Seen({'b' => \&a})->Dumpxs;)
+TEST q(Data::Dumper->new([\&z,$c],['a','c'])->Seen({'b' => \&z})->Dump;);
+TEST q(Data::Dumper->new([\&z,$c],['a','c'])->Seen({'b' => \&z})->Dumpxs;)
if $XS;
############# 127
@@ -591,8 +667,8 @@ TEST q(Data::Dumper->new([\&a,$c],['a','c'])->Seen({'b' => \&a})->Dumpxs;)
#];
EOT
-TEST q(Data::Dumper->new([\&a,$c],['a','c'])->Seen({'*b' => \&a})->Dump;);
-TEST q(Data::Dumper->new([\&a,$c],['a','c'])->Seen({'*b' => \&a})->Dumpxs;)
+TEST q(Data::Dumper->new([\&z,$c],['a','c'])->Seen({'*b' => \&z})->Dump;);
+TEST q(Data::Dumper->new([\&z,$c],['a','c'])->Seen({'*b' => \&z})->Dumpxs;)
if $XS;
############# 133
@@ -604,8 +680,101 @@ TEST q(Data::Dumper->new([\&a,$c],['a','c'])->Seen({'*b' => \&a})->Dumpxs;)
#);
EOT
-TEST q(Data::Dumper->new([\&a,$c],['*a','*c'])->Seen({'*b' => \&a})->Dump;);
-TEST q(Data::Dumper->new([\&a,$c],['*a','*c'])->Seen({'*b' => \&a})->Dumpxs;)
+TEST q(Data::Dumper->new([\&z,$c],['*a','*c'])->Seen({'*b' => \&z})->Dump;);
+TEST q(Data::Dumper->new([\&z,$c],['*a','*c'])->Seen({'*b' => \&z})->Dumpxs;)
+ if $XS;
+
+}
+
+{
+ $a = [];
+ $a->[1] = \$a->[0];
+
+############# 139
+##
+ $WANT = <<'EOT';
+#@a = (
+# undef,
+# ''
+#);
+#$a[1] = \$a[0];
+EOT
+
+TEST q(Data::Dumper->new([$a],['*a'])->Purity(1)->Dump;);
+TEST q(Data::Dumper->new([$a],['*a'])->Purity(1)->Dumpxs;)
+ if $XS;
+}
+
+{
+ $a = \\\\\'foo';
+ $b = $$$a;
+
+############# 145
+##
+ $WANT = <<'EOT';
+#$a = \\\\\'foo';
+#$b = ${${$a}};
+EOT
+
+TEST q(Data::Dumper->new([$a,$b],['a','b'])->Purity(1)->Dump;);
+TEST q(Data::Dumper->new([$a,$b],['a','b'])->Purity(1)->Dumpxs;)
if $XS;
+}
+
+{
+ $a = [{ a => \$b }, { b => undef }];
+ $b = [{ c => \$b }, { d => \$a }];
+
+############# 151
+##
+ $WANT = <<'EOT';
+#$a = [
+# {
+# a => \[
+# {
+# c => ''
+# },
+# {
+# d => \[]
+# }
+# ]
+# },
+# {
+# b => undef
+# }
+#];
+#${$a->[0]{a}}->[0]->{c} = $a->[0]{a};
+#${${$a->[0]{a}}->[1]->{d}} = $a;
+#$b = ${$a->[0]{a}};
+EOT
+TEST q(Data::Dumper->new([$a,$b],['a','b'])->Purity(1)->Dump;);
+TEST q(Data::Dumper->new([$a,$b],['a','b'])->Purity(1)->Dumpxs;)
+ if $XS;
+}
+
+{
+ $a = [[[[\\\\\'foo']]]];
+ $b = $a->[0][0];
+ $c = $${$b->[0][0]};
+
+############# 157
+##
+ $WANT = <<'EOT';
+#$a = [
+# [
+# [
+# [
+# \\\\\'foo'
+# ]
+# ]
+# ]
+#];
+#$b = $a->[0][0];
+#$c = ${${$a->[0][0][0][0]}};
+EOT
+
+TEST q(Data::Dumper->new([$a,$b,$c],['a','b','c'])->Purity(1)->Dump;);
+TEST q(Data::Dumper->new([$a,$b,$c],['a','b','c'])->Purity(1)->Dumpxs;)
+ if $XS;
}
diff --git a/contrib/perl5/t/lib/fatal.t b/contrib/perl5/t/lib/fatal.t
new file mode 100755
index 0000000..fb3757f
--- /dev/null
+++ b/contrib/perl5/t/lib/fatal.t
@@ -0,0 +1,27 @@
+#!./perl -w
+
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+ print "1..9\n";
+}
+
+use strict;
+use Fatal qw(open);
+
+my $i = 1;
+eval { open FOO, '<lkjqweriuapofukndajsdlfjnvcvn' };
+print "not " unless $@ =~ /^Can't open/;
+print "ok $i\n"; ++$i;
+
+my $foo = 'FOO';
+for ('$foo', "'$foo'", "*$foo", "\\*$foo") {
+ eval qq{ open $_, '<$0' };
+ print "not " if $@;
+ print "ok $i\n"; ++$i;
+
+ print "not " unless scalar(<FOO>) =~ m|^#!./perl|;
+ print "not " if $@;
+ print "ok $i\n"; ++$i;
+ close FOO;
+}
diff --git a/contrib/perl5/t/lib/h2ph.pht b/contrib/perl5/t/lib/h2ph.pht
index 80867a6..e5b2932 100644
--- a/contrib/perl5/t/lib/h2ph.pht
+++ b/contrib/perl5/t/lib/h2ph.pht
@@ -1,3 +1,5 @@
+require '_h2ph_pre.ph';
+
unless(defined(&SQUARE)) {
sub SQUARE {
local($x) = @_;
@@ -27,7 +29,7 @@ unless(defined(&_H2PH_H_)) {
if(!(defined (defined(&__SOMETHING_MORE_IMPORTANT) ? &__SOMETHING_MORE_IMPORTANT : 0))) {
}
elsif(!(defined (defined(&__SOMETHING_REALLY_REALLY_IMPORTANT) ? &__SOMETHING_REALLY_REALLY_IMPORTANT : 0))) {
- die("Nup, can't go on ");
+ die("Nup\,\ can\'t\ go\ on\ ");
} else {
eval 'sub EVERYTHING_IS_OK () {1;}' unless defined(&EVERYTHING_IS_OK);
}
diff --git a/contrib/perl5/t/lib/io_udp.t b/contrib/perl5/t/lib/io_udp.t
index 014e12d..ad2632d 100755
--- a/contrib/perl5/t/lib/io_udp.t
+++ b/contrib/perl5/t/lib/io_udp.t
@@ -13,7 +13,7 @@ BEGIN {
if(-d "lib" && -f "TEST") {
if ( ($Config{'extensions'} !~ /\bSocket\b/ ||
$Config{'extensions'} !~ /\bIO\b/ ||
- $^O eq 'os2') &&
+ ($^O eq 'os2') || $^O eq 'apollo') &&
!(($^O eq 'VMS') && $Config{d_socket})) {
print "1..0\n";
exit 0;
diff --git a/contrib/perl5/t/lib/parsewords.t b/contrib/perl5/t/lib/parsewords.t
index 9079179..3c5e75b 100755
--- a/contrib/perl5/t/lib/parsewords.t
+++ b/contrib/perl5/t/lib/parsewords.t
@@ -7,7 +7,7 @@ BEGIN {
use Text::ParseWords;
-print "1..17\n";
+print "1..18\n";
@words = shellwords(qq(foo "bar quiz" zoo));
print "not " if $words[0] ne 'foo';
@@ -101,3 +101,8 @@ $string = 'aaaa"bbbbb" cc\ cc \\\\\"dddd\' eee\\\\\"\\\'ffff\' gg';
$result = join('|', parse_line('\s+', 0, $string));
print "not " unless $result eq 'aaaabbbbb|cc cc|\"dddd eee\\\\"\'ffff|gg';
print "ok 17\n";
+
+# test whitespace in the delimiters
+@words = quotewords(' ', 1, '4 3 2 1 0');
+print "not " unless join(";", @words) eq qq(4;3;2;1;0);
+print "ok 18\n";
diff --git a/contrib/perl5/t/lib/posix.t b/contrib/perl5/t/lib/posix.t
index 8dafc80..f6d8e92 100755
--- a/contrib/perl5/t/lib/posix.t
+++ b/contrib/perl5/t/lib/posix.t
@@ -97,5 +97,5 @@ print POSIX::strftime("ok 18 # %H:%M, on %D\n", localtime());
$| = 0;
# The following line assumes buffered output, which may be not true with EMX:
-print '@#!*$@(!@#$' unless $^O eq 'os2';
+print '@#!*$@(!@#$' unless ($^O eq 'os2' || $^O eq 'uwin' || $^O eq 'os390');
_exit(0);
diff --git a/contrib/perl5/t/lib/safe2.t b/contrib/perl5/t/lib/safe2.t
index c9e3880..6afc117 100755
--- a/contrib/perl5/t/lib/safe2.t
+++ b/contrib/perl5/t/lib/safe2.t
@@ -8,8 +8,8 @@ BEGIN {
print "1..0\n";
exit 0;
}
- # test 30 rather naughtily expects English error messages
- $ENV{'LC_ALL'} = 'C';
+ # test 30 rather naughtily expects English error messages
+ $ENV{'LC_ALL'} = 'C';
}
# Tests Todo:
@@ -122,11 +122,9 @@ print $@ =~ /foo bar/ ? "ok 29\n" : "not ok 29\n";
my $t = 30;
$cpt->rdo('/non/existant/file.name');
-print +(($! =~ /No such file/ || $! =~ /file specification syntax error/) ||
- $! =~ /A file or directory in the path name does not exist/ ||
- $! =~ /Invalid argument/ ||
- $! =~ /Device not configured/ ?
- "ok $t\n" : "not ok $t # $!\n"); $t++;
+# The regexp is getting rather baroque.
+print $! =~ /No such file|file specification syntax error|A file or directory in the path name does not exist|Invalid argument|Device not configured|file not found/i ? "ok $t\n" : "not ok $t # $!\n"; $t++;
+# test #31 is gone.
print 1 ? "ok $t\n" : "not ok $t\n#$@/$!\n"; $t++;
#my $rdo_file = "tmp_rdo.tpl";
diff --git a/contrib/perl5/t/lib/searchdict.t b/contrib/perl5/t/lib/searchdict.t
index 447c425..c36fdb8 100755
--- a/contrib/perl5/t/lib/searchdict.t
+++ b/contrib/perl5/t/lib/searchdict.t
@@ -5,7 +5,7 @@ BEGIN {
@INC = '../lib';
}
-print "1..3\n";
+print "1..4\n";
$DICT = <<EOT;
Aarhus
@@ -44,22 +44,44 @@ open(DICT, "+>dict-$$") or die "Can't create dict-$$: $!";
binmode DICT; # To make length expected one.
print DICT $DICT;
-my $pos = look *DICT, "abash";
+my $pos = look *DICT, "Ababa";
chomp($word = <DICT>);
-print "not " if $pos < 0 || $word ne "abash";
+print "not " if $pos < 0 || $word ne "Ababa";
print "ok 1\n";
-$pos = look *DICT, "foo";
-chomp($word = <DICT>);
+if (ord('a') > ord('A') ) { # ASCII
+
+ $pos = look *DICT, "foo";
+ chomp($word = <DICT>);
+
+ print "not " if $pos != length($DICT); # will search to end of file
+ print "ok 2\n";
-print "not " if $pos != length($DICT); # will search to end of file
-print "ok 2\n";
+ my $pos = look *DICT, "abash";
+ chomp($word = <DICT>);
+ print "not " if $pos < 0 || $word ne "abash";
+ print "ok 3\n";
+
+}
+else { # EBCDIC systems e.g. os390
+
+ $pos = look *DICT, "FOO";
+ chomp($word = <DICT>);
+
+ print "not " if $pos != length($DICT); # will search to end of file
+ print "ok 2\n";
+
+ my $pos = look *DICT, "Abba";
+ chomp($word = <DICT>);
+ print "not " if $pos < 0 || $word ne "Abba";
+ print "ok 3\n";
+}
$pos = look *DICT, "aarhus", 1, 1;
chomp($word = <DICT>);
print "not " if $pos < 0 || $word ne "Aarhus";
-print "ok 3\n";
+print "ok 4\n";
close DICT or die "cannot close";
unlink "dict-$$";
diff --git a/contrib/perl5/t/lib/textfill.t b/contrib/perl5/t/lib/textfill.t
new file mode 100755
index 0000000..19add69
--- /dev/null
+++ b/contrib/perl5/t/lib/textfill.t
@@ -0,0 +1,96 @@
+#!./perl -w
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
+@tests = (split(/\nEND\n/s, <<DONE));
+TEST1
+Cyberdog Information
+
+Cyberdog & Netscape in the news
+Important Press Release regarding Cyberdog and Netscape. Check it out!
+
+Cyberdog Plug-in Support!
+Cyberdog support for Netscape Plug-ins is now available to download! Go
+to the Cyberdog Beta Download page and download it now!
+
+Cyberdog Book
+Check out Jesse Feiler's way-cool book about Cyberdog. You can find
+details out about the book as well as ordering information at Philmont
+Software Mill site.
+
+Java!
+Looking to view Java applets in Cyberdog 1.1 Beta 3? Download and install
+the Mac OS Runtime for Java and try it out!
+
+Cyberdog 1.1 Beta 3
+We hope that Cyberdog and OpenDoc 1.1 will be available within the next
+two weeks. In the meantime, we have released another version of
+Cyberdog, Cyberdog 1.1 Beta 3. This version fixes several bugs that were
+reported to us during out public beta period. You can check out our release
+notes to see what we fixed!
+END
+ Cyberdog Information
+ Cyberdog & Netscape in the news Important Press Release regarding
+ Cyberdog and Netscape. Check it out!
+ Cyberdog Plug-in Support! Cyberdog support for Netscape Plug-ins is now
+ available to download! Go to the Cyberdog Beta Download page and download
+ it now!
+ Cyberdog Book Check out Jesse Feiler's way-cool book about Cyberdog.
+ You can find details out about the book as well as ordering information at
+ Philmont Software Mill site.
+ Java! Looking to view Java applets in Cyberdog 1.1 Beta 3? Download and
+ install the Mac OS Runtime for Java and try it out!
+ Cyberdog 1.1 Beta 3 We hope that Cyberdog and OpenDoc 1.1 will be
+ available within the next two weeks. In the meantime, we have released
+ another version of Cyberdog, Cyberdog 1.1 Beta 3. This version fixes
+ several bugs that were reported to us during out public beta period. You
+ can check out our release notes to see what we fixed!
+END
+DONE
+
+
+$| = 1;
+
+print "1..", @tests/2, "\n";
+
+use Text::Wrap;
+
+$rerun = $ENV{'PERL_DL_NONLAZY'} ? 0 : 1;
+
+$tn = 1;
+while (@tests) {
+ my $in = shift(@tests);
+ my $out = shift(@tests);
+
+ $in =~ s/^TEST(\d+)?\n//;
+
+ my $back = fill(' ', ' ', $in);
+
+ if ($back eq $out) {
+ print "ok $tn\n";
+ } elsif ($rerun) {
+ my $oi = $in;
+ open(F,">#o") and do { print F $back; close(F) };
+ open(F,">#e") and do { print F $out; close(F) };
+ foreach ($in, $back, $out) {
+ s/\t/^I\t/gs;
+ s/\n/\$\n/gs;
+ }
+ print "------------ input ------------\n";
+ print $in;
+ print "\n------------ output -----------\n";
+ print $back;
+ print "\n------------ expected ---------\n";
+ print $out;
+ print "\n-------------------------------\n";
+ $Text::Wrap::debug = 1;
+ fill(' ', ' ', $oi);
+ exit(1);
+ } else {
+ print "not ok $tn\n";
+ }
+ $tn++;
+}
diff --git a/contrib/perl5/t/lib/textwrap.t b/contrib/perl5/t/lib/textwrap.t
index 9c8d1b4..c3a455b 100755
--- a/contrib/perl5/t/lib/textwrap.t
+++ b/contrib/perl5/t/lib/textwrap.t
@@ -1,40 +1,128 @@
-#!./perl
+#!./perl -w
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
}
-print "1..5\n";
+@tests = (split(/\nEND\n/s, <<DONE));
+TEST1
+This
+is
+a
+test
+END
+ This
+ is
+ a
+ test
+END
+TEST2
+This is a test of a very long line. It should be broken up and put onto multiple lines.
+This is a test of a very long line. It should be broken up and put onto multiple lines.
-use Text::Wrap qw(wrap $columns);
+This is a test of a very long line. It should be broken up and put onto multiple lines.
+END
+ This is a test of a very long line. It should be broken up and put onto
+ multiple lines.
+ This is a test of a very long line. It should be broken up and put onto
+ multiple lines.
+
+ This is a test of a very long line. It should be broken up and put onto
+ multiple lines.
+END
+TEST3
+This is a test of a very long line. It should be broken up and put onto multiple lines.
+END
+ This is a test of a very long line. It should be broken up and put onto
+ multiple lines.
+END
+TEST4
+This is a test of a very long line. It should be broken up and put onto multiple lines.
-$columns = 30;
+END
+ This is a test of a very long line. It should be broken up and put onto
+ multiple lines.
-$text = <<'EOT';
-Text::Wrap is a very simple paragraph formatter. It formats a
-single paragraph at a time by breaking lines at word boundries.
-Indentation is controlled for the first line ($initial_tab) and
-all subsquent lines ($subsequent_tab) independently. $Text::Wrap::columns
-should be set to the full width of your output device.
-EOT
+END
+TEST5
+This is a test of a very long line. It should be broken up and put onto multiple This is a test of a very long line. It should be broken up and put
+END
+ This is a test of a very long line. It should be broken up and put onto
+ multiple This is a test of a very long line. It should be broken up and
+ put
+END
+TEST6
+11111111 22222222 33333333 44444444 55555555 66666666 77777777 888888888 999999999 aaaaaaaaa bbbbbbbbb ccccccccc ddddddddd eeeeeeeee ffffffff gggggggg hhhhhhhh iiiiiiii jjjjjjjj kkkkkkkk llllllll mmmmmmmmm nnnnnnnnn ooooooooo ppppppppp qqqqqqqqq rrrrrrrrr sssssssss
+END
+ 11111111 22222222 33333333 44444444 55555555 66666666 77777777 888888888
+ 999999999 aaaaaaaaa bbbbbbbbb ccccccccc ddddddddd eeeeeeeee ffffffff
+ gggggggg hhhhhhhh iiiiiiii jjjjjjjj kkkkkkkk llllllll mmmmmmmmm nnnnnnnnn
+ ooooooooo ppppppppp qqqqqqqqq rrrrrrrrr sssssssss
+END
+TEST7
+c3t1d0s6 c4t1d0s6 c5t1d0s6 c6t1d0s6 c7t1d0s6 c8t1d0s6 c9t1d0s6 c10t1d0s6 c11t1d0s6 c12t1d0s6 c13t1d0s6 c14t1d0s6 c15t1d0s6 c16t1d0s6 c3t1d0s0 c4t1d0s0 c5t1d0s0 c6t1d0s0 c7t1d0s0 c8t1d0s0 c9t1d0s0 c10t1d0s0 c11t1d0s0 c12t1d0s0 c13t1d0s0 c14t1d0s0 c15t1d0s0 c16t1d0s0
+END
+ c3t1d0s6 c4t1d0s6 c5t1d0s6 c6t1d0s6 c7t1d0s6 c8t1d0s6 c9t1d0s6 c10t1d0s6
+ c11t1d0s6 c12t1d0s6 c13t1d0s6 c14t1d0s6 c15t1d0s6 c16t1d0s6 c3t1d0s0
+ c4t1d0s0 c5t1d0s0 c6t1d0s0 c7t1d0s0 c8t1d0s0 c9t1d0s0 c10t1d0s0 c11t1d0s0
+ c12t1d0s0 c13t1d0s0 c14t1d0s0 c15t1d0s0 c16t1d0s0
+END
+TEST8
+A test of a very very long word.
+a123456789b123456789c123456789d123456789e123456789f123456789g123456789g1234567
+END
+ A test of a very very long word.
+ a123456789b123456789c123456789d123456789e123456789f123456789g123456789g123
+ 4567
+END
+TEST9
+A test of a very very long word. a123456789b123456789c123456789d123456789e123456789f123456789g123456789g1234567
+END
+ A test of a very very long word.
+ a123456789b123456789c123456789d123456789e123456789f123456789g123456789g123
+ 4567
+END
+DONE
-$text =~ s/\n/ /g;
-$_ = wrap "| ", "|", $text;
-#print "$_\n";
+$| = 1;
-print "not " unless /^\| Text::Wrap is/; # start is ok
-print "ok 1\n";
+print "1..", @tests/2, "\n";
-print "not " if /^.{31,}$/m; # no line longer than 30 chars
-print "ok 2\n";
+use Text::Wrap;
-print "not " unless /^\|\w/m; # other lines start with
-print "ok 3\n";
+$rerun = $ENV{'PERL_DL_NONLAZY'} ? 0 : 1;
-print "not " unless /\bsubsquent\b/; # look for a random word
-print "ok 4\n";
+$tn = 1;
+while (@tests) {
+ my $in = shift(@tests);
+ my $out = shift(@tests);
-print "not " unless /\bdevice\./; # look for last word
-print "ok 5\n";
+ $in =~ s/^TEST(\d+)?\n//;
+
+ my $back = wrap(' ', ' ', $in);
+
+ if ($back eq $out) {
+ print "ok $tn\n";
+ } elsif ($rerun) {
+ my $oi = $in;
+ foreach ($in, $back, $out) {
+ s/\t/^I\t/gs;
+ s/\n/\$\n/gs;
+ }
+ print "------------ input ------------\n";
+ print $in;
+ print "\n------------ output -----------\n";
+ print $back;
+ print "\n------------ expected ---------\n";
+ print $out;
+ print "\n-------------------------------\n";
+ $Text::Wrap::debug = 1;
+ wrap(' ', ' ', $oi);
+ exit(1);
+ } else {
+ print "not ok $tn\n";
+ }
+ $tn++;
+}
diff --git a/contrib/perl5/t/lib/thread.t b/contrib/perl5/t/lib/thread.t
index 83407a9..c127d0f 100755
--- a/contrib/perl5/t/lib/thread.t
+++ b/contrib/perl5/t/lib/thread.t
@@ -24,7 +24,7 @@ sub content
}
# create a thread passing args and immedaietly wait for it.
-my $t = new Thread \&content,("ok 2\n","ok 3\n");
+my $t = new Thread \&content,("ok 2\n","ok 3\n", 1..1000);
print $t->join;
# check that lock works ...
OpenPOWER on IntegriCloud