From: Nicholas Clark Date: Wed, 10 Apr 2013 11:44:07 +0000 (+0200) Subject: Refactor 3 tests so that they avoid clearing %:: via list assignment. X-Git-Tag: upstream/5.20.0~3448 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fdf38e49aa470e60cb56fdd7a3a49f85da8ea2ce;p=platform%2Fupstream%2Fperl.git Refactor 3 tests so that they avoid clearing %:: via list assignment. For all 3, clearing %:: was intended to expose another bug, not to directly test the effects of clearing %:: Tested by building the 3 revisions that added the tests, and confirming that the revised test also triggers the bug that each fixed. --- diff --git a/t/op/stash.t b/t/op/stash.t index fd5450e..2681d47 100644 --- a/t/op/stash.t +++ b/t/op/stash.t @@ -11,7 +11,7 @@ plan( tests => 58 ); # Used to segfault (bug #15479) fresh_perl_like( - '%:: = ""', + 'delete $::{STDERR}; my %a = ""', qr/Odd number of elements in hash assignment at - line 1\./, { switches => [ '-w' ] }, 'delete $::{STDERR} and print a warning', @@ -59,14 +59,15 @@ package main; { local $ENV{PERL_DESTRUCT_LEVEL} = 2; fresh_perl_is( - 'package A; sub a { // }; %::=""', + 'package A::B; sub a { // }; %A::=""', '', '', ); # Variant of the above which creates an object that persists until global - # destruction. + # destruction, and triggers an assertion failure prior to change + # a420522db95b7762 fresh_perl_is( - 'use Exporter; package A; sub a { // }; %::=""', + 'use Exporter; package A; sub a { // }; delete $::{$_} for keys %::', '', '', );