Skip Menu |

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

Report information
The Basics
Id: 85004
Status: resolved
Priority: 0/
Queue: Test-Class

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

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



CC: MSCHWERN [...] cpan.org
Subject: Fails with MSCHWERN/Test-Simple-0.98_05.tar.gz
As per subject. Let me put it this way: my statistical analysis discovered the correlation. I'm not saying, the bug is on the end of Test::Class. It's just the case that Test::Class now has tests failing with Test::Simple 0.98_04 and 0.98_05 and before anybody wonders what's going on, I want to provide a hint with this bugreport, nothing more. HTH, Thanks && Regards,
From: ppisar [...] redhat.com
Dne Čt 02.Květen.2013 15:58:02, ANDK napsal(a): Show quoted text
> As per subject. > > Let me put it this way: my statistical analysis discovered the > correlation. I'm not saying, the bug is on the end of Test::Class. > It's just the case that Test::Class now has tests failing with > Test::Simple 0.98_04
Fix for issues up to 0.98_04 is attached. Show quoted text
> and 0.98_05
This is tricky. The failure is caused by Test-Simple commit: commit 497965306444982d4948e24811e44e72619885f8 Author: Michael G. Schwern <schwern@pobox.com> Date: Mon Apr 15 17:13:43 2013 +0100 Fix Test::Builder::Tester so it works with subtests. They already work in TB1.5 and this wasn't hard to fix. For #350 Specifically with these hunks: @@ -469,11 +470,19 @@ sub expect { my @checks = @_; foreach my $check (@checks) { + $check = $self->_account_for_subtest($check); $check = $self->_translate_Failed_check($check); push @{ $self->{wanted} }, ref $check ? $check : "$check\n"; } } +sub _account_for_subtest { + my( $self, $check ) = @_; + + # Since we ship with Test::Builder, calling a private method is safe...ish. + return $t->_indent . $check; +} + This causes that test_err() called with a regular expression does not match. I don't know where is the problem. -- Petr
Subject: 0001-Adjust-to-Test-Simple-0.98_04.patch
From eceb5cde6609858e700cbeb2fd787109ce263e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Wed, 7 Aug 2013 10:58:43 +0200 Subject: [PATCH] Adjust to Test-Simple 0.98_04 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit <https://rt.cpan.org/Public/Bug/Display.html?id=85004> Signed-off-by: Petr Písař <ppisar@redhat.com> --- t/fail2.t | 19 ++++++++++++++----- t/runtests_die.t | 17 +++++++++++++---- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/t/fail2.t b/t/fail2.t index 0231685..26d6f54 100644 --- a/t/fail2.t +++ b/t/fail2.t @@ -23,14 +23,23 @@ sub _test_new : Test(3) { package main; $ENV{TEST_VERBOSE}=0; -my $identifier = ($Test::More::VERSION < 0.88) ? 'object' : 'thing'; +my $identifier = 'undef'; +if ($Test::More::VERSION < 0.88) { + $identifier = 'The object'; +} elsif ($Test::More::VERSION < 0.9804) { + $identifier = 'The thing'; +} +my $quote = q{'}; +if ($Test::More::VERSION < 0.9804) { + $quote = q{}; +} -test_out("not ok 1 - The $identifier isa Object"); +test_out("not ok 1 - $identifier isa $quote" . "Object" . "$quote"); test_out("not ok 2 - cannot create Objects"); -test_fail(-12); +test_fail(-21); test_err( "# (in Object::Test->_test_new)" ); -test_err(qr/#\s+The $identifier isn't defined\n/); -test_fail(-15); +test_err(qr/#\s+\Q$identifier\E isn't defined\n/); +test_fail(-24); test_err( "# (in Object::Test->_test_new)" ); Object::Test->runtests; diff --git a/t/runtests_die.t b/t/runtests_die.t index 238ec21..953bd1d 100755 --- a/t/runtests_die.t +++ b/t/runtests_die.t @@ -21,14 +21,23 @@ use Test::Builder::Tester tests => 1; $ENV{TEST_VERBOSE}=0; my $filename = sub { return (caller)[1] }->(); -my $identifier = ($Test::More::VERSION < 0.88) ? 'object' : 'thing'; +my $identifier = 'undef'; +if ($Test::More::VERSION < 0.88) { + $identifier = 'The object'; +} elsif ($Test::More::VERSION < 0.9804) { + $identifier = 'The thing'; +} +my $quote = q{'}; +if ($Test::More::VERSION < 0.9804) { + $quote = q{}; +} -test_out( "not ok 1 - The $identifier isa Object"); +test_out( "not ok 1 - $identifier isa $quote" . "Object" . "$quote"); test_err( "# Failed test ($filename at line 15)"); test_err( "# (in Foo->test_object)" ); -test_err( "# The $identifier isn't defined"); +test_err( "# $identifier isn't defined"); test_out( "not ok 2 - test_object died (could not create object)"); -test_err( "# Failed test ($filename at line 33)"); +test_err( "# Failed test ($filename at line 42)"); test_err( "# (in Foo->test_object)" ); Foo->runtests; test_test("early die handled"); -- 1.8.1.4
From: ppisar [...] redhat.com
Dne St 07.srp.2013 10:36:01, ppisar napsal(a): Show quoted text
> > and 0.98_05
> > This is tricky. The failure is caused by Test-Simple commit:
I reported it to Test-Simple <https://github.com/schwern/test-more/issues/387>. -- Petr
this works in the latest -- rjbs