diff options
author | Eric Brine <ikegami@adaelis.com> | 2011-03-02 17:30:17 -0500 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-06-21 08:37:57 -0700 |
commit | 5cd408a276e19848774860967c3ec06b67b863ee (patch) | |
tree | dd4b575b002a260fd9d4ae4c77ca6a5ed4c73d15 /t | |
parent | 0890f1a536cff0aff68038cae78e02c9d9b6a2b2 (diff) | |
download | perl-5cd408a276e19848774860967c3ec06b67b863ee.tar.gz |
[perl #78462] Don't warn for splice(@a,MAX_LEN)
The intent of splice(@a,MAX_LEN) is quite clearly to truncate
the array if it's too large. There's no reason to warn if it's
currently smaller than the max length.
Diffstat (limited to 't')
-rw-r--r-- | t/lib/warnings/pp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/lib/warnings/pp b/t/lib/warnings/pp index d1581446f0..2251b9420f 100644 --- a/t/lib/warnings/pp +++ b/t/lib/warnings/pp @@ -46,6 +46,25 @@ EXPECT Attempt to use reference as lvalue in substr at - line 5. ######## # pp.c +use warnings 'misc' ; +@a = qw( a b c ); +splice(@a, 4, 0, 'e') ; +@a = qw( a b c ); +splice(@a, 4, 1) ; +@a = qw( a b c ); +splice(@a, 4) ; +no warnings 'misc' ; +@a = qw( a b c ); +splice(@a, 4, 0, 'e') ; +@a = qw( a b c ); +splice(@a, 4, 1) ; +@a = qw( a b c ); +splice(@a, 4) ; +EXPECT +splice() offset past end of array at - line 4. +splice() offset past end of array at - line 6. +######## +# pp.c use warnings 'uninitialized' ; *x = *{ undef() }; no warnings 'uninitialized' ; |