summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-03-10 11:07:46 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-03-10 11:07:46 +0000
commite3d0d1b96b2c9ea39a8c9ab1faca9d150105b22d (patch)
tree6132085b898218965c681010ebaf10ea7ab61bbc /t
parenta63faeb82e1cd769349b7b2ab0ae93c6465d712e (diff)
parent258f629a78127140b4644bf8cc6ec15b387ab089 (diff)
downloadperl-e3d0d1b96b2c9ea39a8c9ab1faca9d150105b22d.tar.gz
Integrate from mainperl.
p4raw-id: //depot/cfgperl@3103
Diffstat (limited to 't')
-rwxr-xr-xt/base/lex.t30
-rw-r--r--t/pragma/warn/1global3
2 files changed, 30 insertions, 3 deletions
diff --git a/t/base/lex.t b/t/base/lex.t
index 6bb39d0ae7..d90d404cac 100755
--- a/t/base/lex.t
+++ b/t/base/lex.t
@@ -1,8 +1,6 @@
#!./perl
-# $RCSfile: lex.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:04 $
-
-print "1..41\n";
+print "1..46\n";
$x = 'x';
@@ -155,6 +153,7 @@ print $foo;
# These next two tests are trying to make sure that
# $^FOO is always global; it doesn't make sense to `my' it.
#
+
eval 'my $^X;';
print "not " unless index ($@, 'Can\'t use global $^X in "my"') > -1;
print "ok 37\n";
@@ -181,4 +180,29 @@ print $foo;
}
+# see if eval '', s///e, and heredocs mix
+sub T {
+ my ($where, $num) = @_;
+ my ($p,$f,$l) = caller;
+ print "# $p:$f:$l vs /$where/\nnot " unless "$p:$f:$l" =~ /$where/;
+ print "ok $num\n";
+}
+
+my $test = 42;
+
+{
+# line 42 "plink"
+ local $_ = "not ok ";
+ eval q{
+ s/^not /<<EOT/e and T '^main:\(eval \d+\):2$', $test++;
+# fuggedaboudit
+EOT
+ print $_, $test++, "\n";
+ T('^main:\(eval \d+\):6$', $test++);
+# line 1 "plunk"
+ T('^main:plunk:1$', $test++);
+ };
+ print "# $@\nnot ok $test\n" if $@;
+ T '^main:plink:53$', $test++;
+}
diff --git a/t/pragma/warn/1global b/t/pragma/warn/1global
index dca47e92ce..836b7f513f 100644
--- a/t/pragma/warn/1global
+++ b/t/pragma/warn/1global
@@ -13,12 +13,14 @@ EXPECT
$a =+ 3 ;
EXPECT
Reversed += operator at - line 3.
+Name "main::a" used only once: possible typo at - line 3.
########
#! perl -w
# warnable code, warnings enabled via #! line
$a =+ 3 ;
EXPECT
Reversed += operator at - line 3.
+Name "main::a" used only once: possible typo at - line 3.
########
# warnable code, warnings enabled via compile time $^W
@@ -26,6 +28,7 @@ BEGIN { $^W = 1 }
$a =+ 3 ;
EXPECT
Reversed += operator at - line 4.
+Name "main::a" used only once: possible typo at - line 4.
########
# compile-time warnable code, warnings enabled via runtime $^W