summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorCharles Bailey <bailey@newman.upenn.edu>2000-03-03 04:42:45 +0000
committerbailey <bailey@newman.upenn.edu>2000-03-03 04:42:45 +0000
commitd7f50f0c498d7fe25779a79348dab4af20b615d3 (patch)
tree9c1592224deffc98a63ab82413d3792adbeec7be /t
parent4466cc18e0cce2c475a3418e94d9c930d241d089 (diff)
parent8c8ad484ae56ad5a81dc3b76a40859fc90c16a10 (diff)
downloadperl-d7f50f0c498d7fe25779a79348dab4af20b615d3.tar.gz
Once more unto resync
p4raw-id: //depot/vmsperl@5482
Diffstat (limited to 't')
-rwxr-xr-xt/lib/anydbm.t24
-rw-r--r--t/lib/syslfs.t56
-rw-r--r--t/op/lfs.t66
-rwxr-xr-xt/op/misc.t2
-rwxr-xr-xt/op/pack.t3
-rwxr-xr-xt/op/pat.t6
-rw-r--r--t/pragma/warn/8signal2
7 files changed, 98 insertions, 61 deletions
diff --git a/t/lib/anydbm.t b/t/lib/anydbm.t
index 9efe5e9f3e..e38c7e7860 100755
--- a/t/lib/anydbm.t
+++ b/t/lib/anydbm.t
@@ -122,24 +122,24 @@ if ($h{''} eq 'bar') {
print "ok 12\n" ;
}
else {
- print "not ok 12\n" ;
if ($AnyDBM_File::ISA[0] eq 'DB_File' && $DB_File::db_ver >= 2.004010) {
($major, $minor, $patch) = ($DB_File::db_ver =~ /^(\d+)\.(\d\d\d)(\d\d\d)/) ;
$major =~ s/^0+// ;
$minor =~ s/^0+// ;
$patch =~ s/^0+// ;
$compact = "$major.$minor.$patch" ;
-
- print STDERR <<EOM ;
-#
-# anydbm.t test 12 will fail when AnyDBM_File uses the combination of
-# DB_File and Berkeley DB 2.4.10 (or greater).
-# You are using DB_File $DB_File::VERSION and Berkeley DB $compact
-#
-# Berkeley DB 2 from version 2.4.10 onwards does not allow null keys.
-# This feature will be reenabled in a future version of Berkeley DB.
-#
-EOM
+ #
+ # anydbm.t test 12 will fail when AnyDBM_File uses the combination of
+ # DB_File and Berkeley DB 2.4.10 (or greater).
+ # You are using DB_File $DB_File::VERSION and Berkeley DB $compact
+ #
+ # Berkeley DB 2 from version 2.4.10 onwards does not allow null keys.
+ # This feature will be reenabled in a future version of Berkeley DB.
+ #
+ print "ok 12 # skipped: db v$compact, no null key support\n" ;
+ }
+ else {
+ print "not ok 12\n" ;
}
}
diff --git a/t/lib/syslfs.t b/t/lib/syslfs.t
index 3b040dc6ac..2857120942 100644
--- a/t/lib/syslfs.t
+++ b/t/lib/syslfs.t
@@ -1,5 +1,5 @@
# NOTE: this file tests how large files (>2GB) work with raw system IO.
-# open(), tell(), seek(), print(), read() are tested in t/op/lfs.t.
+# stdio: open(), tell(), seek(), print(), read() is tested in t/op/lfs.t.
# If you modify/add tests here, remember to update also t/op/lfs.t.
BEGIN {
@@ -14,9 +14,15 @@ BEGIN {
require Fcntl; import Fcntl qw(/^O_/ /^SEEK_/);
}
-sub bye {
+sub zap {
close(BIG);
- unlink "big";
+ unlink("big");
+ unlink("big1");
+ unlink("big2");
+}
+
+sub bye {
+ zap();
exit(0);
}
@@ -59,26 +65,38 @@ if ($^O eq 'unicos') {
# consume less blocks than one megabyte (assuming nobody has
# one megabyte blocks...)
-sysopen(BIG, "big", O_WRONLY|O_CREAT|O_TRUNC) or
- do { warn "sysopen failed: $!\n"; bye };
-sysseek(BIG, 1_000_000, SEEK_SET);
-syswrite(BIG, "big");
-close(BIG);
+sysopen(BIG, "big1", O_WRONLY|O_CREAT|O_TRUNC) or
+ do { warn "sysopen big1 failed: $!\n"; bye };
+sysseek(BIG, 1_000_000, SEEK_SET) or
+ do { warn "sysseek big1 failed: $!\n"; bye };
+syswrite(BIG, "big") or
+ do { warn "syswrite big1 failed; $!\n"; bye };
+close(BIG) or
+ do { warn "close big1 failed: $!\n"; bye };
-my @s;
+my @s1 = stat("big1");
-@s = stat("big");
+print "# s1 = @s1\n";
-print "# @s\n";
+sysopen(BIG, "big2", O_WRONLY|O_CREAT|O_TRUNC) or
+ do { warn "sysopen big2 failed: $!\n"; bye };
+sysseek(BIG, 2_000_000, SEEK_SET) or
+ do { warn "sysseek big2 failed: $!\n"; bye };
+syswrite(BIG, "big") or
+ do { warn "syswrite big2 failed; $!\n"; bye };
+close(BIG) or
+ do { warn "close big2 failed: $!\n"; bye };
-my $BLOCKSIZE = $s[11] || 512;
+my @s2 = stat("big2");
-unless (@s == 13 &&
- $s[7] == 1_000_003 &&
- defined $s[12] &&
- $BLOCKSIZE * $s[12] < 1_000_003) {
- print "1..0\n# no sparse files?\n";
- bye();
+print "# s2 = @s2\n";
+
+zap();
+
+unless ($s1[7] == 1_000_003 && $s2[7] == 2_000_003 &&
+ $s1[11] == $s2[11] && $s1[12] == $s2[12]) {
+ print "1..0\n#no sparse files?\n";
+ bye;
}
print "# we seem to have sparse files...\n";
@@ -181,7 +199,7 @@ fail unless $big eq "big";
print "ok 14\n";
# 705_032_704 = (I32)5_000_000_000
-fail unless seek(BIG, 705_032_704, $SEEK_SET);
+fail unless seek(BIG, 705_032_704, SEEK_SET);
print "ok 15\n";
my $zero;
diff --git a/t/op/lfs.t b/t/op/lfs.t
index 0d6d027743..e704f6f57b 100644
--- a/t/op/lfs.t
+++ b/t/op/lfs.t
@@ -13,9 +13,15 @@ BEGIN {
}
}
-sub bye {
+sub zap {
close(BIG);
- unlink "big";
+ unlink("big");
+ unlink("big1");
+ unlink("big2");
+}
+
+sub bye {
+ zap();
exit(0);
}
@@ -62,26 +68,42 @@ my ($SEEK_SET, $SEEK_CUR, $SEEK_END) = (0, 1, 2);
# consume less blocks than one megabyte (assuming nobody has
# one megabyte blocks...)
-open(BIG, ">big") or do { warn "open failed: $!\n"; bye };
-binmode BIG;
-seek(BIG, 1_000_000, $SEEK_SET);
-print BIG "big";
-close(BIG);
-
-my @s;
-
-@s = stat("big");
-
-print "# @s\n";
-
-my $BLOCKSIZE = $s[11] || 512;
-
-unless (@s == 13 &&
- $s[7] == 1_000_003 &&
- defined $s[12] &&
- $BLOCKSIZE * $s[12] < 1_000_003) {
- print "1..0\n# no sparse files?\n";
- bye();
+open(BIG, ">big1") or
+ do { warn "open big1 failed: $!\n"; bye };
+binmode(BIG) or
+ do { warn "binmode big1 failed: $!\n"; bye };
+seek(BIG, 1_000_000, $SEEK_SET) or
+ do { warn "seek big1 failed: $!\n"; bye };
+print BIG "big" or
+ do { warn "print big1 failed: $!\n"; bye };
+close(BIG) or
+ do { warn "close big1 failed: $!\n"; bye };
+
+my @s1 = stat("big1");
+
+print "# s1 = @s1\n";
+
+open(BIG, ">big2") or
+ do { warn "open big2 failed: $!\n"; bye };
+binmode(BIG) or
+ do { warn "binmode big2 failed: $!\n"; bye };
+seek(BIG, 2_000_000, $SEEK_SET) or
+ do { warn "seek big2 failed; $!\n"; bye };
+print BIG "big" or
+ do { warn "print big2 failed; $!\n"; bye };
+close(BIG) or
+ do { warn "close big2 failed; $!\n"; bye };
+
+my @s2 = stat("big2");
+
+print "# s2 = @s2\n";
+
+zap();
+
+unless ($s1[7] == 1_000_003 && $s2[7] == 2_000_003 &&
+ $s1[11] == $s2[11] && $s1[12] == $s2[12]) {
+ print "1..0\n#no sparse files?\n";
+ bye;
}
print "# we seem to have sparse files...\n";
diff --git a/t/op/misc.t b/t/op/misc.t
index b46c0ccb54..a595694e9b 100755
--- a/t/op/misc.t
+++ b/t/op/misc.t
@@ -482,7 +482,7 @@ new1new22DESTROY2new33DESTROY31DESTROY1
########
re();
sub re {
- my $re = join '', eval 'qr/(?p{ $obj->method })/';
+ my $re = join '', eval 'qr/(??{ $obj->method })/';
$re;
}
EXPECT
diff --git a/t/op/pack.t b/t/op/pack.t
index 867da8dd14..e4c7a9c210 100755
--- a/t/op/pack.t
+++ b/t/op/pack.t
@@ -19,9 +19,6 @@ print ($#ary == $#ary2 ? "ok 1\n" : "not ok 1\n");
$out1=join(':',@ary);
$out2=join(':',@ary2);
-# Using long double NVs may introduce greater accuracy than wanted.
-$out2 =~ s/:9\.87654321097999\d*:/:9.87654321098:/
- if $Config{uselongdouble} eq 'define';
print ($out1 eq $out2? "ok 2\n" : "not ok 2\n");
print ($foo =~ /def/ ? "ok 3\n" : "not ok 3\n");
diff --git a/t/op/pat.t b/t/op/pat.t
index 142b82e2ad..103e6132b5 100755
--- a/t/op/pat.t
+++ b/t/op/pat.t
@@ -370,7 +370,7 @@ print "ok $test\n";
$test++;
my $matched;
-$matched = qr/\((?:(?>[^()]+)|(?p{$matched}))*\)/;
+$matched = qr/\((?:(?>[^()]+)|(??{$matched}))*\)/;
@ans = @ans1 = ();
push(@ans, $res), push(@ans1, $&) while $res = m/$matched/g;
@@ -866,7 +866,7 @@ print "ok $test\n";
$test++;
$brackets = qr{
- { (?> [^{}]+ | (?p{ $brackets }) )* }
+ { (?> [^{}]+ | (??{ $brackets }) )* }
}x;
"{{}" =~ $brackets;
@@ -877,7 +877,7 @@ $test++;
print "ok $test\n"; # Did we survive?
$test++;
-"something { long { and } hairy" =~ m/((?p{ $brackets }))/;
+"something { long { and } hairy" =~ m/((??{ $brackets }))/;
print "not " unless $1 eq "{ and }";
print "ok $test\n";
$test++;
diff --git a/t/pragma/warn/8signal b/t/pragma/warn/8signal
index 80e60330a6..d480f1902a 100644
--- a/t/pragma/warn/8signal
+++ b/t/pragma/warn/8signal
@@ -4,7 +4,7 @@ TODO
__END__
# 8signal
-BEGIN { $SIG{__WARN__} = sub { print "WARN -- @_" } }
+BEGIN { $| = 1; $SIG{__WARN__} = sub { print "WARN -- @_" } }
BEGIN { $SIG{__DIE__} = sub { print "DIE -- @_" } }
1 if 1 EQ 2 ;
use warnings qw(deprecated) ;