summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorTim Bunce <Tim.Bunce@ig.co.uk>1997-06-11 12:00:00 +1200
committerTim Bunce <Tim.Bunce@ig.co.uk>1997-06-11 12:00:00 +1200
commit3e3baf6d63945cb64e829d6e5c70a7d00f3d3d03 (patch)
tree0143be655536dc428f4fa3cc7d01f6bcffe14c01 /t
parent08aa1457cd52a368c210ab76a3da91cfadabea1a (diff)
parent3458556dd685b1767b760a72bd2e9007b5c4575e (diff)
downloadperl-3e3baf6d63945cb64e829d6e5c70a7d00f3d3d03.tar.gz
[differences between cumulative patch application and perl5.004_01]perl-5.004_01
[editor's note: The changes between this and 5.004 were processed from the m1t2 release, which was a bad idea as it was the _01 release which had the final corrected attributions. The differences between the various m*t* releases do that; I considered it most valuable just to look at the _NN releases. Many patches have been separated out and/or applied from the p5p archives nonetheless.]
Diffstat (limited to 't')
-rwxr-xr-xt/lib/safe2.t2
-rwxr-xr-xt/op/flip.t5
-rwxr-xr-xt/op/magic.t26
-rwxr-xr-xt/op/mkdir.t5
-rwxr-xr-xt/op/stat.t39
-rwxr-xr-xt/op/subst.t7
-rwxr-xr-xt/op/taint.t2
7 files changed, 66 insertions, 20 deletions
diff --git a/t/lib/safe2.t b/t/lib/safe2.t
index feaab16956..40c5098058 100755
--- a/t/lib/safe2.t
+++ b/t/lib/safe2.t
@@ -8,6 +8,8 @@ BEGIN {
print "1..0\n";
exit 0;
}
+ # test 30 rather naughtily expects English error messages
+ $ENV{'LC_ALL'} = 'C';
}
# Tests Todo:
diff --git a/t/op/flip.t b/t/op/flip.t
index 475f55a8c8..7852d0cee9 100755
--- a/t/op/flip.t
+++ b/t/op/flip.t
@@ -2,7 +2,7 @@
# $RCSfile: flip.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:52 $
-print "1..8\n";
+print "1..9\n";
@a = (1,2,3,4,5,6,7,8,9,10,11,12);
@@ -24,3 +24,6 @@ while (<of>) {
$x = ($foo =~ y/\n/\n/);
if ($x eq 3) {print "ok 8\n";} else {print "not ok 8 $x:$foo:\n";}
+
+$x = 3.14;
+if (($x...$x) eq "1") {print "ok 9\n";} else {print "not ok 9\n";}
diff --git a/t/op/magic.t b/t/op/magic.t
index c2be2e5e68..49caab56b4 100755
--- a/t/op/magic.t
+++ b/t/op/magic.t
@@ -19,10 +19,11 @@ sub ok {
}
}
-$Is_MSWin32 = ($^O eq 'MSWin32');
+$Is_MSWin32 = $^O eq 'MSWin32';
+$Is_VMS = $^O eq 'VMS';
$PERL = ($Is_MSWin32 ? '.\perl' : './perl');
-print "1..28\n";
+print "1..30\n";
eval '$ENV{"foo"} = "hi there";'; # check that ENV is inited inside eval
if ($Is_MSWin32) { ok 1, `cmd /x /c set foo` eq "foo=hi there\n"; }
@@ -109,7 +110,7 @@ if ($Is_MSWin32) {
for (19 .. 25) { ok $_, 1 }
}
else {
- if ($^O eq 'qnx' || $^O eq 'amigaos') {
+ if ($^O eq 'qnx') {
chomp($wd = `pwd`);
}
else {
@@ -142,3 +143,22 @@ EOF
ok 26, $] >= 5.00319, $];
ok 27, $^O;
ok 28, $^T > 850000000, $^T;
+
+if ($Is_VMS) {
+ ok 29, 1;
+ ok 30, 1;
+}
+else {
+ $PATH = $ENV{PATH};
+ $ENV{foo} = "bar";
+ %ENV = ();
+ $ENV{PATH} = $PATH;
+ ok 29, ($Is_MSWin32 ? (`cmd /x /c set foo 2>NUL` eq "")
+ : (`echo \$foo` eq "\n") );
+
+ $ENV{NoNeSuCh} = "foo";
+ $0 = "bar";
+ ok 30, ($Is_MSWin32 ? (`cmd /x /c set NoNeSuCh` eq "NoNeSuCh=foo\n")
+ : (`echo \$NoNeSuCh` eq "foo\n") );
+}
+
diff --git a/t/op/mkdir.t b/t/op/mkdir.t
index 5a6dfe5f5c..5ba0a0f18d 100755
--- a/t/op/mkdir.t
+++ b/t/op/mkdir.t
@@ -6,9 +6,12 @@ print "1..7\n";
$^O eq 'MSWin32' ? `del /s /q blurfl 2>&1` : `rm -rf blurfl`;
+# tests 3 and 7 rather naughtily expect English error messages
+$ENV{'LC_ALL'} = 'C';
+
print (mkdir('blurfl',0777) ? "ok 1\n" : "not ok 1\n");
print (mkdir('blurfl',0777) ? "not ok 2\n" : "ok 2\n");
-print ($! =~ /exist/ ? "ok 3\n" : "not ok 3\n");
+print ($! =~ /exist|denied/ ? "ok 3\n" : "# $!\nnot ok 3\n");
print (-d 'blurfl' ? "ok 4\n" : "not ok 4\n");
print (rmdir('blurfl') ? "ok 5\n" : "not ok 5\n");
print (rmdir('blurfl') ? "not ok 6\n" : "ok 6\n");
diff --git a/t/op/stat.t b/t/op/stat.t
index c1cc1573b4..aea5cc147c 100755
--- a/t/op/stat.t
+++ b/t/op/stat.t
@@ -74,7 +74,9 @@ if (!$> || ! -r 'Op.stat.tmp') {print "ok 9\n";} else {print "not ok 9\n";}
if (!$> || ! -w 'Op.stat.tmp') {print "ok 10\n";} else {print "not ok 10\n";}
eval '$> = $olduid;'; # switch uid back (may not be implemented)
print "# olduid=$olduid, newuid=$>\n" unless ($> == $olduid);
-if (! -x 'Op.stat.tmp') {print "ok 11\n";} else {print "not ok 11\n";}
+
+if ($Is_MSWin32 or ! -x 'Op.stat.tmp') {print "ok 11\n";}
+else {print "not ok 11\n";}
foreach ((12,13,14,15,16,17)) {
print "ok $_\n"; #deleted tests
@@ -158,24 +160,35 @@ else
tty_test:
-if ($Is_MSWin32) {
- print "ok 36\n";
- print "ok 37\n";
+# To assist in automated testing when a controlling terminal (/dev/tty)
+# may not be available (at, cron rsh etc), the PERL_SKIP_TTY_TEST env var
+# can be set to skip the tests that need a tty.
+unless($ENV{PERL_SKIP_TTY_TEST}) {
+ if ($Is_MSWin32) {
+ print "ok 36\n";
+ print "ok 37\n";
+ }
+ else {
+ unless (open(tty,"/dev/tty")) {
+ print STDERR "Can't open /dev/tty--run t/TEST outside of make.\n";
+ }
+ if (-t tty) {print "ok 36\n";} else {print "not ok 36\n";}
+ if (-c tty) {print "ok 37\n";} else {print "not ok 37\n";}
+ close(tty);
+ }
+ if (! -t tty) {print "ok 38\n";} else {print "not ok 38\n";}
+ if (-t) {print "ok 39\n";} else {print "not ok 39\n";}
}
else {
- unless (open(tty,"/dev/tty")) {
- print STDERR "Can't open /dev/tty--run t/TEST outside of make.\n";
- }
- if (-t tty) {print "ok 36\n";} else {print "not ok 36\n";}
- if (-c tty) {print "ok 37\n";} else {print "not ok 37\n";}
- close(tty);
+ print "ok 36\n";
+ print "ok 37\n";
+ print "ok 38\n";
+ print "ok 39\n";
}
-if (! -t tty) {print "ok 38\n";} else {print "not ok 38\n";}
open(null,"/dev/null");
if (! -t null || -e '/xenix' || $^O eq 'machten' || $Is_MSWin32)
- {print "ok 39\n";} else {print "not ok 39\n";}
+ {print "ok 40\n";} else {print "not ok 40\n";}
close(null);
-if (-t) {print "ok 40\n";} else {print "not ok 40\n";}
# These aren't strictly "stat" calls, but so what?
diff --git a/t/op/subst.t b/t/op/subst.t
index b2332b84d1..3b4734eadb 100755
--- a/t/op/subst.t
+++ b/t/op/subst.t
@@ -2,7 +2,7 @@
# $RCSfile: s.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:22 $
-print "1..60\n";
+print "1..61\n";
$x = 'foo';
$_ = "x";
@@ -229,3 +229,8 @@ print exp_vars('$(DIR)',0) eq '$(UNDEFINEDNAME)/xxx'
print exp_vars('foo $(DIR)/yyy bar',0) eq 'foo $(UNDEFINEDNAME)/xxx/yyy bar'
? "ok 60\n" : "not ok 60\n";
+# a match nested in the RHS of a substitution:
+
+$_ = "abcd";
+s/../$x = $&, m#.#/eg;
+print $x eq "cd" ? "ok 61\n" : "not ok 61\n";
diff --git a/t/op/taint.t b/t/op/taint.t
index 1667152719..e170f284ed 100755
--- a/t/op/taint.t
+++ b/t/op/taint.t
@@ -96,7 +96,7 @@ print "1..135\n";
test 1, eval { `$echo 1` } eq "1\n";
- if ($Is_MSWin32) {
+ if ($Is_MSWin32 || $Is_VMS) {
print "# Environment tainting tests skipped\n";
for (2..5) { print "ok $_\n" }
}