summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerard Goossen <gerard@ggoossen.net>2009-11-10 13:37:38 +0100
committerRafael Garcia-Suarez <rgs@consttype.org>2009-11-13 13:52:55 +0100
commit84df657f04b1025e03d7845847755bde20f5a70c (patch)
treea081c1d08a61dc2768226a5444e78f31234a4da3
parentad2250c8dddabeba39a143c3eff5a0f641ee9402 (diff)
downloadperl-84df657f04b1025e03d7845847755bde20f5a70c.tar.gz
Test for a bug in sort where the elements are freed in the sort block.
-rw-r--r--t/op/sort.t8
1 files changed, 7 insertions, 1 deletions
diff --git a/t/op/sort.t b/t/op/sort.t
index 8484827b6d..75b9a171b3 100644
--- a/t/op/sort.t
+++ b/t/op/sort.t
@@ -6,7 +6,7 @@ BEGIN {
require 'test.pl';
}
use warnings;
-plan( tests => 146 );
+plan( tests => 147 );
# these shouldn't hang
{
@@ -768,6 +768,12 @@ cmp_ok($answer,'eq','good','sort subr called from other package');
cmp_ok(substr($@,0,length($fail_msg)),'eq',$fail_msg,'bug 7567');
}
+{
+ local $TODO = "sort should make sure elements are not freed in the sort block";
+ eval { @nomodify_x=(1..8); our @copy = sort { @nomodify_x = (0) } (@nomodify_x, 3); };
+ is($@, "");
+}
+
# Sorting shouldn't increase the refcount of a sub
{