projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6600848
)
Test out-of-bounds warning with lv substr
author
Father Chrysostomos
<sprout@cpan.org>
Fri, 9 Dec 2011 06:21:51 +0000
(22:21 -0800)
committer
Father Chrysostomos
<sprout@cpan.org>
Fri, 9 Dec 2011 06:21:51 +0000
(22:21 -0800)
t/op/substr.t
patch
|
blob
|
history
diff --git
a/t/op/substr.t
b/t/op/substr.t
index
f93b64c
..
ceacdf6
100644
(file)
--- a/
t/op/substr.t
+++ b/
t/op/substr.t
@@
-23,7
+23,7
@@
$SIG{__WARN__} = sub {
BEGIN { require './test.pl'; }
-plan(38
0
);
+plan(38
1
);
run_tests() unless caller;
@@
-42,6
+42,8
@@
eval{substr($a,999,999) = "" ; };# P R Q S
like ($@, $FATAL_MSG);
is(substr($a,0,-6), 'abc'); # P=Q R S
is(substr($a,-3,1), 'x'); # P Q R S
+sub{$b = shift}->(substr($a,999,999));
+is ($w--, 1, 'boundless lvalue substr only warns on fetch');
substr($a,3,3) = 'XYZ';
is($a, 'abcXYZxyz' );