summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2002-01-28 08:22:36 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2002-01-28 08:22:36 +0000
commitc356d77f02460666e584ca1c1cfabd8207072d8f (patch)
tree0d3b20d8bccfeed945cbd9e1a92bc5502cf8970c /t
parent38506751601bfdd51b90f9e878ed0517263f4fd7 (diff)
parent0bc0ad857ef0ded50c72fba42503c958a1579a5a (diff)
downloadperl-c356d77f02460666e584ca1c1cfabd8207072d8f.tar.gz
Integrate mainline
p4raw-id: //depot/perlio@14463
Diffstat (limited to 't')
-rwxr-xr-xt/op/append.t62
-rwxr-xr-xt/op/pack.t7
-rwxr-xr-xt/op/stat.t3
-rwxr-xr-xt/op/ver.t2
4 files changed, 36 insertions, 38 deletions
diff --git a/t/op/append.t b/t/op/append.t
index 171ed0f0f6..2cb6ab8ead 100755
--- a/t/op/append.t
+++ b/t/op/append.t
@@ -35,46 +35,40 @@ if ($_ eq 'abcdef') {print "ok 3\n";} else {print "not ok 3\n";}
# test that nul bytes get copied
{
-# 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 ($a, $ab) = ("a", "a\0b");
+ my ($u, $ub) = map pack("U0a*", $_), $a, $ab;
+
+ my $c = $u eq $a ? 'b' : pack("U0a*", 'b');
+
my $t1 = $a; $t1 .= $ab;
- print $t1 =~ /\142/ ? "ok 6\n" : "not ok 6\t# $t1\n";
+
+ print $t1 =~ /$c/ ? "ok 6\n" : "not ok 6\t# $t1\n";
+
my $t2 = $a; $t2 .= $ub;
- if (ord('A') == 193) {
- # print $t2 eq "\141\141\000" ? "ok 7\n" : "not ok 7\t# $t2\n";
- print eval '$t2 =~ /\141/' ? "ok 7\n" : "not ok 7\t# $t2\n";
- }
- else {
- print eval '$t2 =~ /\142/' ? "ok 7\n" : "not ok 7\t# $t2\n";
- }
+
+ print eval '$t2 =~ /$c/' ? "ok 7\n" : "not ok 7\t# $t2\n";
+
my $t3 = $u; $t3 .= $ab;
- print $t3 =~ /\142/ ? "ok 8\n" : "not ok 8\t# $t3\n";
+
+ print $t3 =~ /$c/ ? "ok 8\n" : "not ok 8\t# $t3\n";
+
my $t4 = $u; $t4 .= $ub;
- if (ord('A') == 193) {
- print eval '$t4 =~ /\141/' ? "ok 9\n" : "not ok 9\t# $t4\n";
- }
- else {
- print eval '$t4 =~ /\142/' ? "ok 9\n" : "not ok 9\t# $t4\n";
- }
+
+ print eval '$t4 =~ /$c/' ? "ok 9\n" : "not ok 9\t# $t4\n";
+
my $t5 = $a; $t5 = $ab . $t5;
- print $t5 =~ /\142/ ? "ok 10\n" : "not ok 10\t# $t5\n";
+
+ print $t5 =~ /$c/ ? "ok 10\n" : "not ok 10\t# $t5\n";
+
my $t6 = $a; $t6 = $ub . $t6;
- if (ord('A') == 193) {
- print eval '$t6 =~ /\141/' ? "ok 11\n" : "not ok 11\t# $t6\n";
- }
- else {
- print eval '$t6 =~ /\142/' ? "ok 11\n" : "not ok 11\t# $t6\n";
- }
+
+ print eval '$t6 =~ /$c/' ? "ok 11\n" : "not ok 11\t# $t6\n";
+
my $t7 = $u; $t7 = $ab . $t7;
- print $t7 =~ /\142/ ? "ok 12\n" : "not ok 12\t# $t7\n";
+
+ print $t7 =~ /$c/ ? "ok 12\n" : "not ok 12\t# $t7\n";
+
my $t8 = $u; $t8 = $ub . $t8;
- if (ord('A') == 193) {
- print eval '$t8 =~ /\141/' ? "ok 13\n" : "not ok 13\t# $t8\n";
- }
- else {
- print eval '$t8 =~ /\142/' ? "ok 13\n" : "not ok 13\t# $t8\n";
- }
+
+ print eval '$t8 =~ /$c/' ? "ok 13\n" : "not ok 13\t# $t8\n";
}
diff --git a/t/op/pack.t b/t/op/pack.t
index f6f9448d2f..38d015bd01 100755
--- a/t/op/pack.t
+++ b/t/op/pack.t
@@ -680,17 +680,18 @@ foreach (
# from Wolfgang Laun: fix in change #13163
my $s = 'ABC' x 10;
- my $x = 42;
+ my $t = '*';
+ my $x = ord($t);
my $buf = pack( 'Z*/A* C', $s, $x );
my $y;
my $h = $buf;
$h =~ s/[^[:print:]]/./g;
( $s, $y ) = unpack( "Z*/A* C", $buf );
- is($h, "30.ABCABCABCABCABCABCABCABCABCABC*");
+ is($h, "30.ABCABCABCABCABCABCABCABCABCABC$t");
is(length $buf, 34);
is($s, "ABCABCABCABCABCABCABCABCABCABC");
- is($y, 42);
+ is($y, $x);
}
{
diff --git a/t/op/stat.t b/t/op/stat.t
index dac954acd0..c3bbe8362d 100755
--- a/t/op/stat.t
+++ b/t/op/stat.t
@@ -216,8 +216,11 @@ SKIP: {
# /dev/stdout might be either character special or a named pipe,
# or a symlink, or a socket, depending on which OS and how are
# you running the test, so let's censor that one away.
+ # Similar remarks hold for stderr.
$DEV =~ s{^[cpls].+?\sstdout$}{}m;
@DEV = grep { $_ ne 'stdout' } @DEV;
+ $DEV =~ s{^[cpls].+?\sstderr$}{}m;
+ @DEV = grep { $_ ne 'stderr' } @DEV;
# /dev/printer is also naughty: in IRIX it shows up as
# Srwx-----, not srwx------.
diff --git a/t/op/ver.t b/t/op/ver.t
index ecfc15c059..a7e57a63ce 100755
--- a/t/op/ver.t
+++ b/t/op/ver.t
@@ -32,7 +32,7 @@ else { # EBCDIC
# hash keys too
$h{v150.146} = "ok";
- is('ok',$h{v111.107},'ASCII hash keys');
+ is('ok',$h{v150.146},'EBCDIC hash keys');
}
# poetry optimization should also