diff options
author | reneeb <unknown> | 2008-11-16 22:13:57 -0800 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2008-11-25 03:51:41 +0000 |
commit | b08e453b5ad23d251311b831812c303bc4595012 (patch) | |
tree | c1370a4731e75dc069a28cb35218d24f0cd17e65 /t | |
parent | 8226a3d7ea7a9414bc41d73011d23876bd55e4b8 (diff) | |
download | perl-b08e453b5ad23d251311b831812c303bc4595012.tar.gz |
[perl #7911] no warning for useless /d in tr/0-9//d
From: "reneeb via RT" <perlbug-followup@perl.org>
Message-ID: <rt-3.6.HEAD-10965-1226931231-1833.7911-15-0@perl.org>
p4raw-id: //depot/perl@34905
Diffstat (limited to 't')
-rw-r--r-- | t/lib/warnings/op | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/t/lib/warnings/op b/t/lib/warnings/op index 9740e39b92..cc968c7ed0 100644 --- a/t/lib/warnings/op +++ b/t/lib/warnings/op @@ -551,7 +551,7 @@ Useless use of a constant (undef) in void context at - line 8. # op.c # use warnings 'misc' ; -my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ; +my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ;my $d = 'test'; @a =~ /abc/ ; @a =~ s/a/b/ ; @a =~ tr/a/b/ ; @@ -564,9 +564,11 @@ my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ; %$c =~ /abc/ ; %$c =~ s/a/b/ ; %$c =~ tr/a/b/ ; +$d =~ tr/a/b/d ; +$d =~ tr/a/bc/; { no warnings 'misc' ; -my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ; +my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ; my $d = 'test'; @a =~ /abc/ ; @a =~ s/a/b/ ; @a =~ tr/a/b/ ; @@ -579,6 +581,8 @@ my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ; %$c =~ /abc/ ; %$c =~ s/a/b/ ; %$c =~ tr/a/b/ ; +$d =~ tr/a/b/d ; +$d =~ tr/a/bc/ ; } EXPECT Applying pattern match (m//) to @array will act on scalar(@array) at - line 5. @@ -593,8 +597,10 @@ Applying transliteration (tr///) to %hash will act on scalar(%hash) at - line 13 Applying pattern match (m//) to %hash will act on scalar(%hash) at - line 14. Applying substitution (s///) to %hash will act on scalar(%hash) at - line 15. Applying transliteration (tr///) to %hash will act on scalar(%hash) at - line 16. +Useless use of /d modifier in transliteration operator at - line 17. +Replacement list is longer than search list at - line 18. Can't modify private array in substitution (s///) at - line 6, near "s/a/b/ ;" -BEGIN not safe after errors--compilation aborted at - line 18. +BEGIN not safe after errors--compilation aborted at - line 20. ######## # op.c use warnings 'parenthesis' ; |