summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2016-05-02 13:59:28 +0100
committerRicardo Signes <rjbs@cpan.org>2016-05-03 11:23:03 -0400
commita21b01b71e8d60c4063525294714681dc88a5bcd (patch)
treee191388f80b9bce85b4312e3a38b42243dd88f7e /t
parent5f58a6bfe359e4057623eb7db1a92e73495eddb8 (diff)
downloadperl-a21b01b71e8d60c4063525294714681dc88a5bcd.tar.gz
test lexical $foo = "$foo"
There were some issues with this and SvGROW(). This only occured under valgrind or similar, and only when the first of two reverts had been done - those revertd being two preceding commits. See RT #127855.
Diffstat (limited to 't')
-rw-r--r--t/op/lex_assign.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/op/lex_assign.t b/t/op/lex_assign.t
index 4ea3f243ec..c4a5062b6c 100644
--- a/t/op/lex_assign.t
+++ b/t/op/lex_assign.t
@@ -197,6 +197,24 @@ eval {
};
is($@, '', 'ex-PVBM assert'.$@);
+# RT perl #127855
+# Check that stringification and assignment to itself doesn't break
+# anything. This is unlikely to actually fail the tests; its more something
+# for valgrind to spot. It will also only fail if SvGROW or its caller
+# decides to over-allocate (otherwise copying the string will skip the
+# sv_grow(), as the new size is the same as the current size).
+
+{
+ my $s;
+ for my $len (1..40) {
+ $s = 'x' x $len;
+ my $t = $s;
+ $t = "$t";
+ ok($s eq $t, "RT 127855: len=$len");
+ }
+}
+
+
done_testing();
__END__