fresh_perl.t: Make the test for #3066 more explicit
authorFather Chrysostomos <sprout@cpan.org>
Wed, 24 Jul 2013 15:35:46 +0000 (08:35 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 26 Jul 2013 06:48:03 +0000 (23:48 -0700)
This test was added to make sure that constants don’t become undefined
as a result of being shared between ops.

What was tested, though, was a side-effect, and not the actual bug
itself.

This behaviour has changed (sub(){42} now returns a mutable val-
ue), so this test needs to change, too.  It was only passing under
ithreads, and only as the result of another bug, which the next com-
mit will fix.

t/run/fresh_perl.t

index 376ceaf..7f90cd3 100644 (file)
@@ -527,12 +527,13 @@ my $x = "foo";
 EXPECT
 foo
 ########
+# [perl #3066]
 sub C () { 1 }
-sub M { $_[0] = 2; }
+sub M { print "$_[0]\n" }
 eval "C";
 M(C);
 EXPECT
-Modification of a read-only value attempted at - line 2.
+1
 ########
 print qw(ab a\b a\\b);
 EXPECT