diff options
Diffstat (limited to 'meta/recipes-devtools/perl/perl/fixes/test-builder-reset.diff')
-rw-r--r-- | meta/recipes-devtools/perl/perl/fixes/test-builder-reset.diff | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/meta/recipes-devtools/perl/perl/fixes/test-builder-reset.diff b/meta/recipes-devtools/perl/perl/fixes/test-builder-reset.diff new file mode 100644 index 0000000000..9774d2cce2 --- /dev/null +++ b/meta/recipes-devtools/perl/perl/fixes/test-builder-reset.diff @@ -0,0 +1,70 @@ +From 940e2f641870a85d44b8c53e505c8ebccb39f2b1 Mon Sep 17 00:00:00 2001 +From: Chad Granum <exodist7@gmail.com> +Date: Wed, 1 Feb 2017 19:33:57 -0800 +Subject: Reset inside subtest maintains parent + +When TB->reset is called from within a subtest it should maintain the +link to the parent, this link is necessary for unwinding the TB-stack. + +Fixes #757 + +[backported to Debian Perl 5.26 by Niko Tyni <ntyni@debian.org>] + +Origin: backport, https://github.com/Test-More/test-more/commit/68775db7eef1a7e30dc03abf8feabcf3e32301d4 +Bug: https://github.com/Test-More/test-more/issues/757 +Bug-Debian: https://bugs.debian.org/865894 +Patch-Name: fixes/test-builder-reset.diff +--- + cpan/Test-Simple/lib/Test/Builder.pm | 4 +++- + cpan/Test-Simple/t/regression/757-reset_in_subtest.t | 20 ++++++++++++++++++++ + 2 files changed, 23 insertions(+), 1 deletion(-) + create mode 100644 cpan/Test-Simple/t/regression/757-reset_in_subtest.t + +diff --git a/cpan/Test-Simple/lib/Test/Builder.pm b/cpan/Test-Simple/lib/Test/Builder.pm +index 052e2793b9..851a5f6669 100644 +--- a/cpan/Test-Simple/lib/Test/Builder.pm ++++ b/cpan/Test-Simple/lib/Test/Builder.pm +@@ -143,7 +143,8 @@ sub parent { + my $chub = $self->{Hub} || $ctx->hub; + $ctx->release; + +- my $parent = $chub->meta(__PACKAGE__, {})->{parent}; ++ my $meta = $chub->meta(__PACKAGE__, {}); ++ my $parent = $meta->{parent}; + + return undef unless $parent; + +@@ -388,6 +389,7 @@ sub reset { ## no critic (Subroutines::ProhibitBuiltinHomonyms) + Done_Testing => undef, + Skip_All => 0, + Test_Results => [], ++ parent => $meta->{parent}, + ); + + $self->{Exported_To} = undef; +diff --git a/cpan/Test-Simple/t/regression/757-reset_in_subtest.t b/cpan/Test-Simple/t/regression/757-reset_in_subtest.t +new file mode 100644 +index 0000000000..846a34d835 +--- /dev/null ++++ b/cpan/Test-Simple/t/regression/757-reset_in_subtest.t +@@ -0,0 +1,20 @@ ++use strict; ++use warnings; ++ ++use Test::More; ++ ++subtest 'subtest' => sub { ++ Test::Builder->new->reset; ++ ok 1; ++}; ++ ++subtest 'subtest' => sub { ++ Test::Builder->new->reset; ++ subtest 'subtest' => sub { ++ Test::Builder->new->reset; ++ ok 1; ++ }; ++ ok 1; ++}; ++ ++done_testing; |