summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-02-24 10:30:11 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-02-24 10:30:11 +0000
commitebf1a2feae7df8a971c8e3f6df7764df635eadae (patch)
treea9447ec53cb85b3ef6cb74f967d91776576e3ef5 /t
parente8a44d0f80cd5679558cebbf0012c4fc47ef47d4 (diff)
parentd220deaf856c3cdabaa2d430105b75dfc20fe531 (diff)
downloadperl-ebf1a2feae7df8a971c8e3f6df7764df635eadae.tar.gz
Integrate mainline
p4raw-id: //depot/perlio@8920
Diffstat (limited to 't')
-rwxr-xr-xt/lib/ftmp-mktemp.t17
-rwxr-xr-xt/lib/ftmp-posix.t50
-rw-r--r--t/lib/st-06compat.t9
-rwxr-xr-xt/op/append.t21
-rwxr-xr-xt/op/lex_assign.t2
-rwxr-xr-xt/op/pack.t15
6 files changed, 58 insertions, 56 deletions
diff --git a/t/lib/ftmp-mktemp.t b/t/lib/ftmp-mktemp.t
index 2209baa025..4e31d01a3f 100755
--- a/t/lib/ftmp-mktemp.t
+++ b/t/lib/ftmp-mktemp.t
@@ -31,7 +31,7 @@ print "# MKSTEMP: FH is $fh File is $template fileno=".fileno($fh)."\n";
ok( (-e $template) );
# Autoflush
-$fh->autoflush(1) if $] >= 5.006;
+$fh->autoflush(1) if $] >= 5.006;
# Try printing something to the file
my $string = "woohoo\n";
@@ -56,11 +56,16 @@ ok($string, $line);
if ($^O eq 'MSWin32') {
sleep 3;
}
-ok( unlink0($fh, $template) );
-
+my $status = unlink0($fh, $template);
+if ($status) {
+ ok( $status );
+} else {
+ skip("Skip test failed probably due to \$TMPDIR being on NFS",1);
+}
# MKSTEMPS
-# File with suffix. This is created in the current directory
+# File with suffix. This is created in the current directory so
+# may be problematic on NFS
$template = "suffixXXXXXX";
my $suffix = ".dat";
@@ -73,12 +78,12 @@ ok( (-e $fname) );
# This fails if you are running on NFS
# If this test fails simply skip it rather than doing a hard failure
-my $status = unlink0($fh, $fname);
+$status = unlink0($fh, $fname);
if ($status) {
ok($status);
} else {
- skip("Skip test failed probably due to NFS",1)
+ skip("Skip test failed probably due to cwd being on NFS",1)
}
# MKDTEMP
diff --git a/t/lib/ftmp-posix.t b/t/lib/ftmp-posix.t
index bc3845c22b..0a5e86061b 100755
--- a/t/lib/ftmp-posix.t
+++ b/t/lib/ftmp-posix.t
@@ -36,32 +36,48 @@ print "# TMPNAM: in list context: $fh $tmpnam\n";
# File is opened - make sure it exists
ok( (-e $tmpnam ));
-# Unlink it
-ok( unlink0($fh, $tmpnam) );
+# Unlink it - a possible NFS issue again if TMPDIR is not a local disk
+my $status = unlink0($fh, $tmpnam);
+if ($status) {
+ ok( $status );
+} else {
+ skip("Skip test failed probably due to \$TMPDIR being on NFS",1);
+}
# TMPFILE
$fh = tmpfile();
-ok( $fh );
-print "# TMPFILE: tmpfile got FH $fh\n";
+if (defined $fh) {
+ ok( $fh );
+ print "# TMPFILE: tmpfile got FH $fh\n";
+
+ $fh->autoflush(1) if $] >= 5.006;
+
+ # print something to it
+ my $original = "Hello a test\n";
+ print "# TMPFILE: Wrote line: $original";
+ print $fh $original
+ or die "Error printing to tempfile\n";
-$fh->autoflush(1) if $] >= 5.006;
+ # rewind it
+ ok( seek($fh,0,0) );
-# print something to it
-my $original = "Hello a test\n";
-print "# TMPFILE: Wrote line: $original";
-print $fh $original
- or die "Error printing to tempfile\n";
+ # Read from it
+ my $line = <$fh>;
-# rewind it
-ok( seek($fh,0,0) );
+ print "# TMPFILE: Read line: $line";
+ ok( $original, $line);
+
+ close($fh);
+
+} else {
+ # Skip all the remaining tests
+ foreach (1..3) {
+ skip("Skip test failed probably due to \$TMPDIR being on NFS",1);
+ }
+}
-# Read from it
-my $line = <$fh>;
-print "# TMPFILE: Read line: $line";
-ok( $original, $line);
-close($fh);
diff --git a/t/lib/st-06compat.t b/t/lib/st-06compat.t
index b18aed0b58..1586b18a81 100644
--- a/t/lib/st-06compat.t
+++ b/t/lib/st-06compat.t
@@ -155,12 +155,3 @@ M!`(````!"(188@9324U03$586%A8`````V]B:@0,!``````*6%A8`````W)E
#M```!R`H#]$OU`````Y6DE`0"````!001!N+)U-?3Q0(````!"(`$$@("````
#M`0B!!!("`@````$(@@02`@(````!"(,$$@("`````0B$`````Y:"D00`````
#E!`````&(!`(````#"@:BHYF)E8<$``````0$```````````!@0``
-#
-# using Storable-0.6@11, output of: print '#' . pack("u", nfreeze(ROOT->make));
-# on OS/390 (cp 1047) original size: 217 bytes
-#
-#M!0,1!-G6UN,#````!00,!!$)X\G%Q&W(P>+(`P````(*!*6!D_$````$DH6H
-#M\0H$I8&3\@````22A:CR`````YF%A@0"````!@B!"(`(?0H(8/-+\?3Q]?D)
-#M```!R`H#]$OU`````Y6DE`0"````!001!N+)U-?3Q0(````!"(`$$@("````
-#M`0B!!!("`@````$(@@02`@(````!"(,$$@("`````0B$`````Y:"D00`````
-#E!`````&(!`(````#"@:BHYF)E8<$``````0$```````````!@0``
diff --git a/t/op/append.t b/t/op/append.t
index afaf6a1d41..5aa4bf9007 100755
--- a/t/op/append.t
+++ b/t/op/append.t
@@ -35,22 +35,25 @@ if ($_ eq 'abcdef') {print "ok 3\n";} else {print "not ok 3\n";}
# test that nul bytes get copied
{
- my($a, $ab) = ("a", "a\000b");
+# Character 'b' occurs at codepoint 130 decimal or \202 octal
+# under an EBCDIC coded character set.
+# my($a, $ab) = ("a", "a\000b");
+ my($a, $ab) = ("\141", "\141\000\142");
my($u, $ub) = map pack("U0a*", $_), $a, $ab;
my $t1 = $a; $t1 .= $ab;
- print $t1 =~ /b/ ? "ok 6\n" : "not ok 6\t# $t1\n";
+ print $t1 =~ /\142/ ? "ok 6\n" : "not ok 6\t# $t1\n";
my $t2 = $a; $t2 .= $ub;
- print $t2 =~ /b/ ? "ok 7\n" : "not ok 7\t# $t2\n";
+ print $t2 =~ /\142/ ? "ok 7\n" : "not ok 7\t# $t2\n";
my $t3 = $u; $t3 .= $ab;
- print $t3 =~ /b/ ? "ok 8\n" : "not ok 8\t# $t3\n";
+ print $t3 =~ /\142/ ? "ok 8\n" : "not ok 8\t# $t3\n";
my $t4 = $u; $t4 .= $ub;
- print $t4 =~ /b/ ? "ok 9\n" : "not ok 9\t# $t4\n";
+ print $t4 =~ /\142/ ? "ok 9\n" : "not ok 9\t# $t4\n";
my $t5 = $a; $t5 = $ab . $t5;
- print $t5 =~ /b/ ? "ok 10\n" : "not ok 10\t# $t5\n";
+ print $t5 =~ /\142/ ? "ok 10\n" : "not ok 10\t# $t5\n";
my $t6 = $a; $t6 = $ub . $t6;
- print $t6 =~ /b/ ? "ok 11\n" : "not ok 11\t# $t6\n";
+ print $t6 =~ /\142/ ? "ok 11\n" : "not ok 11\t# $t6\n";
my $t7 = $u; $t7 = $ab . $t7;
- print $t7 =~ /b/ ? "ok 12\n" : "not ok 12\t# $t7\n";
+ print $t7 =~ /\142/ ? "ok 12\n" : "not ok 12\t# $t7\n";
my $t8 = $u; $t8 = $ub . $t8;
- print $t8 =~ /b/ ? "ok 13\n" : "not ok 13\t# $t8\n";
+ print $t8 =~ /\142/ ? "ok 13\n" : "not ok 13\t# $t8\n";
}
diff --git a/t/op/lex_assign.t b/t/op/lex_assign.t
index 181c842030..ee74d93478 100755
--- a/t/op/lex_assign.t
+++ b/t/op/lex_assign.t
@@ -244,7 +244,7 @@ lc $cstr # lc
quotemeta $cstr # quotemeta
@$aref # rv2av
@$undefed # rv2av undef
-each %h==1 # each
+(each %h) % 2 == 1 # each
values %h # values
keys %h # keys
%$href # rv2hv
diff --git a/t/op/pack.t b/t/op/pack.t
index db033f3013..3483597fbe 100755
--- a/t/op/pack.t
+++ b/t/op/pack.t
@@ -6,7 +6,7 @@ BEGIN {
require Config; import Config;
}
-print "1..165\n";
+print "1..163\n";
$format = "c2 x5 C C x s d i l a6";
# Need the expression in here to force ary[5] to be numeric. This avoids
@@ -453,16 +453,3 @@ print "ok $test\n"; $test++;
print "ok $test\n"; $test++;
}
-# 164: pack C and pack U equivalence
-
-print "not " unless pack("C", 0x100) eq pack("U", 0x100) &&
- chr(0x100) eq pack("U", 0x100);
-print "ok $test\n"; $test++;
-
-# 165: unpack C and unpack U equivalence
-
-print "not " unless "@{[unpack('C*', chr(0x100) . chr(0x200))]}" eq
- "@{[unpack('U*', chr(0x100) . chr(0x200))]}" &&
- "@{[unpack('U*', chr(0x100) . chr(0x200))]}" eq "256 512";
-print "ok $test\n"; $test++;
-