Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Simple CPAN distribution.

Report information
The Basics
Id: 123003
Status: resolved
Priority: 0/
Queue: Test-Simple

People
Owner: Nobody in particular
Requestors: 'spro^^*%*^6ut# [...] &$%*c
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: [PATCH] Fix to work with subref-in-stash optimisation
Sorry for not using GitHub, but GitHub is a bit flaky for me right now. See the attached patch, which you should be able to feed straight into ‘git am’.
Subject: open_6AeQqWxM.txt
From: Father Chrysostomos <sprout@cpan.org> Fix to work with subref-in-stash optimisation The subref-in-stash optimisation introduced in perl 5.22 accidentally applied only to the main package. I am trying to rectify that now, but it causes Test::Simple to fail its tests, because it assumes that any defined sub has already created a typeglob in the stash. A sub ref cannot be dereferenced with *{ }. diff --git a/lib/Test2/Event/Generic.pm b/lib/Test2/Event/Generic.pm index ad00f5a..67ec877 100644 --- a/lib/Test2/Event/Generic.pm +++ b/lib/Test2/Event/Generic.pm @@ -35,15 +35,12 @@ sub init { for my $field (@FIELDS) { no strict 'refs'; - my $stash = \%{__PACKAGE__ . "::"}; *$field = sub { exists $_[0]->{$field} ? $_[0]->{$field} : () } - unless defined $stash->{$field} - && defined *{$stash->{$field}}{CODE}; + unless exists &{$field}; *{"set_$field"} = sub { $_[0]->{$field} = $_[1] } - unless defined $stash->{"set_$field"} - && defined *{$stash->{"set_$field"}}{CODE}; + unless exists &{"set_$field"}; } sub summary {
On Sun Sep 10 17:21:13 2017, SPROUT wrote: Show quoted text
> Sorry for not using GitHub, but GitHub is a bit flaky for me right > now. See the attached patch, which you should be able to feed > straight into ‘git am’.
BTW, I hope this can be incorporated into bleadperl soon, since I need it to fix perl bug #129916.
Merged, and just put out a release to cpan tonight.