Re: [Perlunit-devel] oh dear
Status: Beta
Brought to you by:
mca1001
|
From: Adam S. <ad...@sp...> - 2001-12-20 20:54:39
|
Adam Spiers (ad...@sp...) wrote:
> Think I just found some bad brokenness, although it could be just me
> getting hopelessly confused as my brain gets trampled into mush by a
> quagmire of exceptions and assertions. I have a testcase:
>
> sub test_this_should_fail {
> my $self = shift;
> $self->assert(sub { $_[0] eq $_[1] or die "$_[0] ne $_[1]" }, 'a', 'b');
> }
>
> which does not fail. In fact it behaves identically to
>
> sub test_this_should_fail {
> my $self = shift;
> $self->assert(sub { $_[0] eq $_[1] or die "$_[0] ne $_[1]" }, 'a', 'a');
> }
>
> Can anyone reproduce with latest CVS?
Ignore that. The problem is that the die() from within a
Assertion::CodeRef produces an Error::Simple, which gets turned into a
Test::Unit::Failure too far up the stack, so if
test_this_should_fail() is in AssertTest.pm, it won't work with
check_failures(). Argh. What to do?
|