Skip Menu |

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

Report information
The Basics
Id: 110959
Status: resolved
Priority: 0/
Queue: Test-More-Prefix

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

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



Subject: Test fail with latest unstable Test::More
This may be a regression or an intentional change in Test::More 1.302013_006: # Failed test 'Note msg interception works' # at t/010_test_builder_0.t line 52. # got: '# No prefix - a # # With prefix - c # # No prefix - e # ' # expected: '# No prefix - a # # Hi there!: With prefix - c # # No prefix - e # ' # Failed test 'Diag msg interception works' # at t/010_test_builder_0.t line 60. # got: '# No prefix - b # # With prefix - d # # No prefix - f # ' # expected: '# No prefix - b # # Hi there!: With prefix - d # # No prefix - f # ' # Looks like you failed 2 tests of 3. t/010_test_builder_0.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/3 subtests
On 2016-01-06 18:30:44, SREZIC wrote: Show quoted text
> This may be a regression or an intentional change in Test::More > 1.302013_006: > > # Failed test 'Note msg interception works' > # at t/010_test_builder_0.t line 52. > # got: '# No prefix - a > # # With prefix - c > # # No prefix - e > # ' > # expected: '# No prefix - a > # # Hi there!: With prefix - c > # # No prefix - e > # ' > > # Failed test 'Diag msg interception works' > # at t/010_test_builder_0.t line 60. > # got: '# No prefix - b > # # With prefix - d > # # No prefix - f > # ' > # expected: '# No prefix - b > # # Hi there!: With prefix - d > # # No prefix - f > # ' > # Looks like you failed 2 tests of 3. > t/010_test_builder_0.t .. > Dubious, test returned 2 (wstat 512, 0x200) > Failed 2/3 subtests
I created also an issue against Test::More, in case this is an unintentional regression: https://github.com/Test-More/test-more/issues/624
I will try to have a patch for this when I have a moment.
On Wed Jan 06 16:36:43 2016, EXODIST wrote: Show quoted text
> I will try to have a patch for this when I have a moment.
Here is the patch.
Subject: 0001-Change-from-Test-Stream-to-Test2.patch
From b22e32e94a7f6ef52d3470e9502e85b262a3e7e8 Mon Sep 17 00:00:00 2001 From: Chad Granum <exodist7@gmail.com> Date: Tue, 15 Mar 2016 08:44:50 -0700 Subject: [PATCH] Change from Test::Stream to Test2 --- lib/Test/More/Prefix.pm | 2 +- lib/Test/More/Prefix/TB2.pm | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/Test/More/Prefix.pm b/lib/Test/More/Prefix.pm index 221204d..01237a9 100644 --- a/lib/Test/More/Prefix.pm +++ b/lib/Test/More/Prefix.pm @@ -55,7 +55,7 @@ use Test::More; sub import { my ( $class, @args ) = @_; - if ( $INC{'Test/Stream.pm'} ) { + if ( $INC{'Test2/API.pm'} ) { require Test::More::Prefix::TB2; Test::More::Prefix::TB2->import(@args); } else { diff --git a/lib/Test/More/Prefix/TB2.pm b/lib/Test/More/Prefix/TB2.pm index 8f39004..ea93f01 100644 --- a/lib/Test/More/Prefix/TB2.pm +++ b/lib/Test/More/Prefix/TB2.pm @@ -14,18 +14,17 @@ sub test_prefix { $prefix = shift(); } -Test::Stream->shared->munge( +Test2::API::test2_stack->top->filter( sub { - my ( $stream, @e ) = @_; + my ( $stream, $e ) = @_; - for my $e (@e) { - next unless $prefix; - next - unless $e->isa('Test::Stream::Event::Diag') - || $e->isa('Test::Stream::Event::Note'); + return $e unless $prefix; + return $e unless $e->isa('Test2::Event::Diag') + || $e->isa('Test2::Event::Note'); - $e->set_message( "$prefix: " . $e->message ); - } + $e->set_message( "$prefix: " . $e->message ); + + return $e; } ); -- 2.7.2