Re: [Perlunit-devel] oh dear
Status: Beta
Brought to you by:
mca1001
|
From: Piers C. <pdc...@bo...> - 2001-12-21 01:13:07
|
Adam Spiers <ad...@sp...> writes:
> 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?
Hmm... I'm thinking.
--
Piers
"It is a truth universally acknowledged that a language in
possession of a rich syntax must be in need of a rewrite."
-- Jane Austen?
|