Go for it, good luck, patches welcome. :)
--
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
d...@sidhe.org have teddy bears and even
teddy bears get drunk
> Apparently it doesn't work.
Hm, I think it does work, just not the way Leo wants. I'll look again
today.
-- c
Cool. If they do work, could you fire a quick note on how to the
list, so I don't forget again?
> Cool. If they do work, could you fire a quick note on how to the
> list, so I don't forget again?
Alright, here's a TODO test:
use Parrot::Test tests => 2;
use Test::More;
TODO:
{
local $TODO = 'Not implemented yet';
ok( 0, 'Sufficiently large values of zero are true' );
is( 1, 2, 'Sufficiently large values of one are two' );
}
Since Parrot::Test doesn't export TODO or $TODO, you have to use
Test::More. Once you've done that, create a new block labelled TODO to
contain all of the tests that may fail. Localize the global $TODO with
the reason you want to display and write your tests as normal.
If you run this file directly, you'll see the failures with the $TODO
reason in the test comment:
$ perl -Ilib t/todo_example.t
not ok 1 - Sufficiently large values of zero are true # TODO Not
implemented yet
# Failed (TODO) test (t/example.t at line 9)
not ok 2 - Sufficiently large values of one are two # TODO Not
implemented yet
# Failed (TODO) test (t/example.t at line 10)
# got: '1'
# expected: '2'
If you run this through Test::Harness, it'll pick up on the # TODO
comments and report that the tests succeeded. (Hey, they failed, but
you expected them to fail, so everything is okay.)
$ perl t/harness t/todo_example.t
t/example....ok
All tests successful.
Files=1, Tests=2, 0 wallclock secs ( 0.08 cusr + 0.00 csys = 0.08
CPU)
If for some reason one of the tests suddenly starts to succeed, you'll
see a different message from the harness:
$ perl t/harness t/example.t
t/example....ok
1/2 unexpectedly succeeded
All tests successful (1 subtest UNEXPECTEDLY SUCCEEDED).
Files=1, Tests=2, 0 wallclock secs ( 0.07 cusr + 0.01 csys = 0.08
CPU)
Leo wants the harness to report TODO tests that fail as expected; that's
a little more complex, but it's doable.
-- c
Cool--thanks much for the explanation.
>Leo wants the harness to report TODO tests that fail as expected; that's
>a little more complex, but it's doable.
If you can, great. If not, even this is fine.
>>Leo wants the harness to report TODO tests that fail as expected; that's
>>a little more complex, but it's doable.
> If you can, great. If not, even this is fine.
Well, there is exactly one TODO test in t/pmc/*. It you have a look at
that one "this is fine" :)
leo