diff options
author | Father Chrysostomos <sprout@cpan.org> | 2015-08-19 13:10:16 -0700 |
---|---|---|
committer | Ricardo Signes <rjbs@cpan.org> | 2015-09-29 10:49:19 -0400 |
commit | 7fba29668402ec06ad00dfafda69913bcbb2c1df (patch) | |
tree | 70b3e0d3f06e47f23571ce6f95c09991ee83b39b /t/comp | |
parent | 96f902ff649ca0f75966f5282611d16ecf5f907e (diff) | |
download | perl-7fba29668402ec06ad00dfafda69913bcbb2c1df.tar.gz |
Disable lexical $_
This just disables the syntax and modifes the tests. The underlying
infrastructure has not been removed yet.
I had to change a couple of tests in cpan/.
Diffstat (limited to 't/comp')
-rw-r--r-- | t/comp/uproto.t | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/t/comp/uproto.t b/t/comp/uproto.t index f81e31411c..9db6d54644 100644 --- a/t/comp/uproto.t +++ b/t/comp/uproto.t @@ -1,6 +1,6 @@ #!perl -print "1..43\n"; +print "1..32\n"; my $test = 0; sub failed { @@ -71,25 +71,6 @@ like( $@, qr/Not enough arguments for main::f at/ ); eval q{ f(1,2,3,4) }; like( $@, qr/Too many arguments for main::f at/ ); -{ - # We have not tested require/use/no yet, so we must avoid this: - # no warnings 'deprecated'; - BEGIN { $SIG{__WARN__} = sub {} } - my $_ = "quarante-deux"; - BEGIN { $SIG{__WARN__} = undef } - $foo = "FOO"; - $bar = "BAR"; - f("FOO quarante-deux", $foo); - f("BAR quarante-deux", $bar); - f("y quarante-deux", substr("xy",1,1)); - f("1 quarante-deux", ("abcdef" =~ /abc/)); - f("not undef quarante-deux", $undef || "not undef"); - f(" quarante-deux", -f "no_such_file"); - f("FOOBAR quarante-deux", ($foo . $bar)); - f("FOOBAR quarante-deux", ($foo .= $bar)); - f("FOOBAR quarante-deux", $foo); -} - &f(""); # no error sub g(_) { is(shift, $expected) } @@ -101,9 +82,6 @@ $_ = $expected; g(); g; undef $expected; &g; # $_ not passed -BEGIN { $SIG{__WARN__} = sub {} } -{ $expected = my $_ = "bar"; g() } -BEGIN { $SIG{__WARN__} = undef } eval q{ sub wrong1 (_$); wrong1(1,2) }; like( $@, qr/Malformed prototype for main::wrong1/, 'wrong1' ); @@ -147,10 +125,3 @@ sub double(_) { $_[0] *= 2 } $_ = 21; double(); is( $_, 42, '$_ is modifiable' ); -{ - BEGIN { $SIG{__WARN__} = sub {} } - my $_ = 22; - BEGIN { $SIG{__WARN__} = undef } - double(); - is( $_, 44, 'my $_ is modifiable' ); -} |