diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-03-14 21:10:09 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-03-14 21:10:09 +0000 |
commit | 5da4baf7965da69c0b59c8683d446777cff89c61 (patch) | |
tree | 8504c47e0f540dc93c00511ca7727db5cb1a2c7a /t/pragma | |
parent | 192cbf1b06bd0b1c75cb42877f87ad6c99aa68e0 (diff) | |
download | perl-5da4baf7965da69c0b59c8683d446777cff89c61.tar.gz |
The Day of the Retractions continues: the #9138
(integrated in #9144) doesn't work well in mainline.
p4raw-id: //depot/perl@9158
Diffstat (limited to 't/pragma')
-rw-r--r-- | t/pragma/strict-vars | 6 | ||||
-rw-r--r-- | t/pragma/warn/op | 2 | ||||
-rw-r--r-- | t/pragma/warn/regcomp | 6 | ||||
-rw-r--r-- | t/pragma/warn/toke | 46 | ||||
-rw-r--r-- | t/pragma/warnings.t | 1 |
5 files changed, 36 insertions, 25 deletions
diff --git a/t/pragma/strict-vars b/t/pragma/strict-vars index 40b55572b8..5ba579d969 100644 --- a/t/pragma/strict-vars +++ b/t/pragma/strict-vars @@ -151,6 +151,8 @@ $d = 1;$i = 1;$n = 1; $e = 1;$j = 1;$o = 1; $p = 0b12; --FILE-- +# known scalar leak +BEGIN { $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; } use abc; EXPECT Global symbol "$f" requires explicit package name at abc.pm line 3. @@ -169,8 +171,8 @@ Global symbol "$o" requires explicit package name at abc.pm line 7. Global symbol "$p" requires explicit package name at abc.pm line 8. Illegal binary digit '2' at abc.pm line 8, at end of line abc.pm has too many errors. -Compilation failed in require at - line 1. -BEGIN failed--compilation aborted at - line 1. +Compilation failed in require at - line 3. +BEGIN failed--compilation aborted at - line 3. ######## # Check scope of pragma with eval diff --git a/t/pragma/warn/op b/t/pragma/warn/op index f3c0548e57..de326f8b0c 100644 --- a/t/pragma/warn/op +++ b/t/pragma/warn/op @@ -569,7 +569,7 @@ Useless use of a constant in void context at - line 3. Useless use of a constant in void context at - line 4. ######## # op.c -# +BEGIN{ $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; } # known scalar leak use warnings 'misc' ; my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ; @a =~ /abc/ ; diff --git a/t/pragma/warn/regcomp b/t/pragma/warn/regcomp index 8b86b5082f..59076d5f3b 100644 --- a/t/pragma/warn/regcomp +++ b/t/pragma/warn/regcomp @@ -50,7 +50,7 @@ EXPECT Unrecognized escape \m passed through before HERE mark in regex m/a\m << HERE / at - line 4. ######## # regcomp.c [S_regpposixcc S_checkposixcc] -# +BEGIN { $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3 } use warnings 'regexp' ; $_ = "" ; /[:alpha:]/; @@ -66,7 +66,7 @@ POSIX syntax [: :] belongs inside character classes before HERE mark in regex m/ POSIX class [:zog:] unknown before HERE mark in regex m/[[:zog:] << HERE ]/ ######## # regcomp.c [S_checkposixcc] -# +BEGIN { $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3 } use warnings 'regexp' ; $_ = "" ; /[.zog.]/; @@ -77,7 +77,7 @@ POSIX syntax [. .] belongs inside character classes before HERE mark in regex m/ POSIX syntax [. .] is reserved for future extensions before HERE mark in regex m/[.zog.] << HERE / ######## # regcomp.c [S_checkposixcc] -# +BEGIN { $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3 } use warnings 'regexp' ; $_ = "" ; /[[.zog.]]/; diff --git a/t/pragma/warn/toke b/t/pragma/warn/toke index 4924bb2dff..2c9433bd7d 100644 --- a/t/pragma/warn/toke +++ b/t/pragma/warn/toke @@ -169,6 +169,10 @@ EXPECT Semicolon seems to be missing at - line 3. ######## # toke.c +BEGIN { + # Scalars leaked: due to syntax errors + $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; +} use warnings 'syntax' ; my $a =+ 2 ; $a =- 2 ; @@ -181,21 +185,25 @@ $a =| 2 ; $a =< 2 ; $a =/ 2 ; EXPECT -Reversed += operator at - line 3. -Reversed -= operator at - line 4. -Reversed *= operator at - line 5. -Reversed %= operator at - line 6. -Reversed &= operator at - line 7. -Reversed .= operator at - line 8. -Reversed ^= operator at - line 9. -Reversed |= operator at - line 10. -Reversed <= operator at - line 11. -syntax error at - line 8, near "=." -syntax error at - line 9, near "=^" -syntax error at - line 10, near "=|" -Unterminated <> operator at - line 11. -######## -# toke.c +Reversed += operator at - line 7. +Reversed -= operator at - line 8. +Reversed *= operator at - line 9. +Reversed %= operator at - line 10. +Reversed &= operator at - line 11. +Reversed .= operator at - line 12. +Reversed ^= operator at - line 13. +Reversed |= operator at - line 14. +Reversed <= operator at - line 15. +syntax error at - line 12, near "=." +syntax error at - line 13, near "=^" +syntax error at - line 14, near "=|" +Unterminated <> operator at - line 15. +######## +# toke.c +BEGIN { + # Scalars leaked: due to syntax errors + $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; +} no warnings 'syntax' ; my $a =+ 2 ; $a =- 2 ; @@ -208,10 +216,10 @@ $a =| 2 ; $a =< 2 ; $a =/ 2 ; EXPECT -syntax error at - line 8, near "=." -syntax error at - line 9, near "=^" -syntax error at - line 10, near "=|" -Unterminated <> operator at - line 11. +syntax error at - line 12, near "=." +syntax error at - line 13, near "=^" +syntax error at - line 14, near "=|" +Unterminated <> operator at - line 15. ######## # toke.c use warnings 'syntax' ; diff --git a/t/pragma/warnings.t b/t/pragma/warnings.t index e2c7500582..872e6e1417 100644 --- a/t/pragma/warnings.t +++ b/t/pragma/warnings.t @@ -5,6 +5,7 @@ BEGIN { @INC = '../lib'; $ENV{PERL5LIB} = '../lib'; require Config; import Config; + $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; } $| = 1; |