summaryrefslogtreecommitdiff
path: root/t/comp
diff options
context:
space:
mode:
authorLarry Wall <larry@netlabs.com>1993-11-10 00:00:00 +0000
committerLarry Wall <larry@netlabs.com>1993-11-10 00:00:00 +0000
commit463ee0b2acbd047c27e8b5393cdd8398881824c5 (patch)
treeae17d9179fc861ae5fc5a86da9139631530cb6fe /t/comp
parent93a17b20b6d176db3f04f51a63b0a781e5ffd11c (diff)
downloadperl-463ee0b2acbd047c27e8b5393cdd8398881824c5.tar.gz
perl 5.0 alpha 4
[editor's note: the sparc executables have not been included, and emacs backup files have been removed. This was reconstructed from a tarball found on the September 1994 InfoMagic CD; the date of this is approximate]
Diffstat (limited to 't/comp')
-rwxr-xr-xt/comp/cmdopt.t18
-rwxr-xr-xt/comp/package.t10
2 files changed, 15 insertions, 13 deletions
diff --git a/t/comp/cmdopt.t b/t/comp/cmdopt.t
index 1ee3581464..4d5c78a4cb 100755
--- a/t/comp/cmdopt.t
+++ b/t/comp/cmdopt.t
@@ -33,7 +33,7 @@ if (1 || $x) { print "ok 15\n";} else { print "not ok 15\n";}
if (0 || $x) { print "not ok 16\n";} else { print "ok 16\n";}
-# test the optimization of registers
+# test the optimization of variables
$x = 1;
if ($x) { print "ok 17\n";} else { print "not ok 17\n";}
@@ -55,18 +55,18 @@ if ($a !~ /a/) { print "not ok 24\n";} else { print "ok 24\n";}
$a = 'a';
$x = 1;
-if ($a eq 'a' && $x) { print "ok 25\n";} else { print "not ok 25\n";}
-if ($a ne 'a' && $x) { print "not ok 26\n";} else { print "ok 26\n";}
+if ($a eq 'a' and $x) { print "ok 25\n";} else { print "not ok 25\n";}
+if ($a ne 'a' and $x) { print "not ok 26\n";} else { print "ok 26\n";}
$x = '';
-if ($a eq 'a' && $x) { print "not ok 27\n";} else { print "ok 27\n";}
-if ($a ne 'a' && $x) { print "not ok 28\n";} else { print "ok 28\n";}
+if ($a eq 'a' and $x) { print "not ok 27\n";} else { print "ok 27\n";}
+if ($a ne 'a' and $x) { print "not ok 28\n";} else { print "ok 28\n";}
$x = 1;
-if ($a eq 'a' || $x) { print "ok 29\n";} else { print "not ok 29\n";}
-if ($a ne 'a' || $x) { print "ok 30\n";} else { print "not ok 30\n";}
+if ($a eq 'a' or $x) { print "ok 29\n";} else { print "not ok 29\n";}
+if ($a ne 'a' or $x) { print "ok 30\n";} else { print "not ok 30\n";}
$x = '';
-if ($a eq 'a' || $x) { print "ok 31\n";} else { print "not ok 31\n";}
-if ($a ne 'a' || $x) { print "not ok 32\n";} else { print "ok 32\n";}
+if ($a eq 'a' or $x) { print "ok 31\n";} else { print "not ok 31\n";}
+if ($a ne 'a' or $x) { print "not ok 32\n";} else { print "ok 32\n";}
$x = 1;
if ($a =~ /a/ && $x) { print "ok 33\n";} else { print "not ok 33\n";}
diff --git a/t/comp/package.t b/t/comp/package.t
index 5237011a62..456c0ffa4d 100755
--- a/t/comp/package.t
+++ b/t/comp/package.t
@@ -19,14 +19,16 @@ $ABC'dyick = 6;
$xyz = 2;
-$main = join(':', sort(keys _main));
-$XYZ = join(':', sort(keys _XYZ));
-$ABC = join(':', sort(keys _ABC));
+$main = join(':', sort(keys %::_main));
+$XYZ = join(':', sort(keys %::_XYZ));
+$ABC = join(':', sort(keys %::_ABC));
print $XYZ eq 'ABC:XYZ:bar:main:xyz' ? "ok 1\n" : "not ok 1 '$XYZ'\n";
-print $ABC eq 'blurfl:dyick' ? "ok 2\n" : "not ok 2\n";
+print $ABC eq 'blurfl:dyick' ? "ok 2\n" : "not ok 2 '$ABC'\n";
print $main'blurfl == 123 ? "ok 3\n" : "not ok 3\n";
+
package ABC;
+
print $blurfl == 5 ? "ok 4\n" : "not ok 4\n";
eval 'print $blurfl == 5 ? "ok 5\n" : "not ok 5\n";';
eval 'package main; print $blurfl == 123 ? "ok 6\n" : "not ok 6\n";';