Skip to content
Snippets Groups Projects
Commit 39ab9b42 authored by Niko Tyni's avatar Niko Tyni
Browse files

Backport upstream patch from 1.302076 to unbreak libapache2-authcookie-perl

Closes: #865893
parent 20ee97a3
No related branches found
No related tags found
No related merge requests found
libtest-simple-perl (1.302075-2) UNRELEASED; urgency=medium
* Backport upstream patch from 1.302076 to unbreak the
libapache2-authcookie-perl test suite. (Closes: #865893)
-- Niko Tyni <ntyni@debian.org> Sun, 09 Jul 2017 22:52:22 +0300
libtest-simple-perl (1.302075-1) unstable; urgency=medium
* Import upstream version 1.302075.
......
From 68775db7eef1a7e30dc03abf8feabcf3e32301d4 Mon Sep 17 00:00:00 2001
From: Chad Granum <exodist7@gmail.com>
Date: Wed, 1 Feb 2017 19:33:57 -0800
Subject: [PATCH] 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
Origin: upstream, https://github.com/Test-More/test-more/commit/68775db7eef1a7e30dc03abf8feabcf3e32301d4
Bug-Debian: https://bugs.debian.org/865893
Bug: https://github.com/Test-More/test-more/issues/757
---
lib/Test/Builder.pm | 4 +++-
t/regression/757-reset_in_subtest.t | 20 ++++++++++++++++++++
2 files changed, 23 insertions(+), 1 deletion(-)
create mode 100644 t/regression/757-reset_in_subtest.t
diff --git a/lib/Test/Builder.pm b/lib/Test/Builder.pm
index c0eaf1a7..7960787e 100644
--- a/lib/Test/Builder.pm
+++ b/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/t/regression/757-reset_in_subtest.t b/t/regression/757-reset_in_subtest.t
new file mode 100644
index 00000000..846a34d8
--- /dev/null
+++ b/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;
--
2.13.2
0001-Reset-inside-subtest-maintains-parent.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment