On Saturday 17 May 2008 20:48:24 Aristotle Pagaltzis wrote:
> You’re not following.
>
> 1. There is non-broken code which isn’t being tested directly.
>
> 2. There is a test that ensures its correctness, but only
> indirectly, as part of testing something else.
>
> 3. That something else is currently broken, so the test is
> annotated TODO.
>
> End result: if the untested non-broken code breaks, you don’t
> notice.
>
> Arguably, you should write a test that covers the non-broken code
> directly so you don’t need to care about the TODO’d test.
>
> But that may be comparatively hard for a number of conceivable
> reasons. Ensuring that the TODO continues to break in the
> expected fashion may well be cheaper than any of the “proper”
> options and provides similar safety.
There's a lot more "maybe" in that paragraph than I like. People already have
to modify the TODO test to add whatever kind of positive assertion you
postulate; why is writing a separate test a barrier?
You can already achieve similar results with:
my $do_i_care_flag;
my $result;
{
local $TODO = 'b0rked';
$result = some_behavior();
$do_i_care_flag = !ok( $result, 'This might be b0rked' );
}
if ($do_i_care_flag)
{
is( $result, 'some value i care about',
'... borked in a predictable way anyway' );
}
else
{
pass( '... but I don't care' );
}
You can skip that block if you have no plan.
-- c