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: 78204
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:
  • 0.98
  • 1.005000_005
Fixed in: (no value)



Subject: Confusing isa_ok diagnostics: ‘it's a ''’
With 0.98: $ ./perl -Ilib -MTest::More -e 'isa_ok "foo", "bar"' not ok 1 - The class isa bar # Failed test 'The class isa bar' # at -e line 1. # The class isn't a 'bar' it's a '' # Tests were run but no plan was declared and done_testing() was not seen. With 1.005000_005: $ perl5.8.9 -MTest::More -e 'isa_ok "foo", "bar"' TAP version 13 not ok 1 - The class isa bar # Failed test 'The class isa bar' # at -e line 1. # The class isn't a 'bar' it's a '' # 1 test ran, but no plan was declared. # 1 test of 1 failed. In any case, please see perl ticket #105922, which was how I discovered this.
Subject: Re: [rt.cpan.org #78204] Confusing isa_ok diagnostics: ‘it's a ''’
Date: Wed, 11 Jul 2012 13:25:42 -0700
To: bug-Test-Simple [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
On 2012.7.4 12:35 PM, Father Chrysostomos via RT wrote: Show quoted text
> $ ./perl -Ilib -MTest::More -e 'isa_ok "foo", "bar"' > not ok 1 - The class isa bar > # Failed test 'The class isa bar' > # at -e line 1. > # The class isn't a 'bar' it's a '' > # Tests were run but no plan was declared and done_testing() was not seen.
Thanks for the report! Yep, that's no good. That message probably needs some logic to remember if it's evaluating a class or an object. Make it so! -- 7. Not allowed to add "In accordance with the prophesy" to the end of answers I give to a question an officer asks me. -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army http://skippyslist.com/list/
On Wed Jul 11 16:25:56 2012, schwern@pobox.com wrote: Show quoted text
> On 2012.7.4 12:35 PM, Father Chrysostomos via RT wrote:
> > $ ./perl -Ilib -MTest::More -e 'isa_ok "foo", "bar"' > > not ok 1 - The class isa bar > > # Failed test 'The class isa bar' > > # at -e line 1. > > # The class isn't a 'bar' it's a '' > > # Tests were run but no plan was declared and done_testing() was not seen.
> > Thanks for the report! > > Yep, that's no good. That message probably needs some logic to remember if > it's evaluating a class or an object. Make it so!
Here am a patch for thee.
Subject: open_tpDjrjpm.txt
diff -rup Test-Simple-1.005000_005-1aRKug-orig/lib/Test/More.pm Test-Simple-1.005000_005-1aRKug/lib/Test/More.pm --- Test-Simple-1.005000_005-1aRKug-orig/lib/Test/More.pm 2012-04-26 15:23:18.000000000 -0700 +++ Test-Simple-1.005000_005-1aRKug/lib/Test/More.pm 2012-08-03 22:42:30.000000000 -0700 @@ -624,7 +624,8 @@ WHOA $obj_name = "The $whatami" unless defined $obj_name; if( !$rslt ) { my $ref = ref $object; - $diag = "$obj_name isn't a '$class' it's a '$ref'"; + $ref = $ref ? "a '$ref'" : "'$object'"; + $diag = "$obj_name isn't a '$class' it's $ref"; } } } diff -rup Test-Simple-1.005000_005-1aRKug-orig/t/fail-more.t Test-Simple-1.005000_005-1aRKug/t/fail-more.t --- Test-Simple-1.005000_005-1aRKug-orig/t/fail-more.t 2012-04-26 14:55:15.000000000 -0700 +++ Test-Simple-1.005000_005-1aRKug/t/fail-more.t 2012-08-03 22:43:18.000000000 -0700 @@ -24,7 +24,7 @@ package My::Test; # Test::Builder's own and the ending diagnostics don't come out right. require Test::Builder; my $TB = Test::Builder->create; -$TB->plan(tests => 80); +$TB->plan(tests => 82); sub like ($$;$) { $TB->like(@_); @@ -51,7 +51,7 @@ package main; require Test::More; our $TODO; -my $Total = 38; +my $Total = 39; Test::More->import(tests => $Total); $out->read; # clear the plan from $out @@ -286,6 +286,16 @@ OUT # The reference isn't a 'HASH' it's a 'ARRAY' ERR +#line 277 +isa_ok("keratoconjunctivitis", "eye::ailment"); +out_ok( <<OUT, <<ERR ); +not ok - The class isa eye::ailment +OUT +# Failed test 'The class isa eye::ailment' +# at $0 line 277. +# The class isn't a 'eye::ailment' it's 'keratoconjunctivitis' +ERR + #line 278 new_ok(undef); out_like( <<OUT, <<ERR );
On Wed Jul 04 12:35:51 2012, SPROUT wrote: Show quoted text
> With 0.98: > > $ ./perl -Ilib -MTest::More -e 'isa_ok "foo", "bar"' > not ok 1 - The class isa bar > # Failed test 'The class isa bar' > # at -e line 1. > # The class isn't a 'bar' it's a '' > # Tests were run but no plan was declared and done_testing() was not > seen. > > With 1.005000_005: > > $ perl5.8.9 -MTest::More -e 'isa_ok "foo", "bar"' > TAP version 13 > not ok 1 - The class isa bar > # Failed test 'The class isa bar' > # at -e line 1. > # The class isn't a 'bar' it's a '' > # 1 test ran, but no plan was declared. > # 1 test of 1 failed. > > In any case, please see perl ticket #105922, which was how I > discovered this.
This appears to have been fixed: exodist@abydos $ perl -MTest::More -e 'isa_ok "foo", "bar"' (master)[~/projects/Test2-Manual] not ok 1 - The class (or class-like) 'foo' isa 'bar' # Failed test 'The class (or class-like) 'foo' isa 'bar'' # at -e line 1. # The class (or class-like) 'foo' isn't a 'bar' # Tests were run but no plan was declared and done_testing() was not seen. exodist@abydos $ perl -e 'use Test::More; print "$Test::More::VERSION"' (master)[~/projects/Test2-Manual] 1.302064%