Ovid wrote:
> Here's we have a test where the plan is 1..3 but we've run 7 tests.
> 
>   TAPx-Parser $ prove -v t/sample-tests/too_many
>   t/sample-tests/too_many...1..3
>   ok 1
>   ok 2
>   ok 3
>   ok 4
>   ok 5
>   ok 6
>   ok 7
>   dubious
>           Test returned status 4 (wstat 1024, 0x400)
>   DIED. FAILED tests 4-7
>           Failed 4/3 tests, -33.33% okay
>   Failed Test             Stat Wstat Total Fail  List of Failed
>   
> -------------------------------------------------------------------------------
>   t/sample-tests/too_many    4  1024     3    4  4-7
>   Failed 1/1 test scripts. -4/3 subtests failed.
>   Files=1, Tests=3,  0 wallclock secs ( 0.01 cusr +  0.01 csys =  0.02 CPU)
>   Failed 1/1 test programs. -4/3 subtests failed.
>  
> The last three tests have passed, but Test::Harness says they've failed.  My 
> TAPx::Parser reports that they've passed and the only real way to know if 
> there's a problem is to test the $parser->good_plan method.  I've added this 
> as a parse error, but why are the passing tests listed as failing?

Your parser behavior is correct.  You'll notice Test::Harness does that, too.

            too_many         => {
                                 total => {
                                           bonus       => 0,
                                           max         => 3,
                                           'ok'        => 7,  # see?  7 ok
                                           files       => 1,
                                           bad         => 1,
                                           good        => 0,
                                           tests       => 1,
                                           sub_skipped => 0,
                                           'todo'      => 0,
                                           skipped     => 0,
                                          },
                                 failed => {
                                            canon      => '4-7',  # this is 
what gets displayed
                                           },
                                 all_ok => 0,
                                },

They're only displayed as failing for the reasons others have said.  You, as 
parser, don't have to worry about that.  Just give the displayer enough 
information to figure it out, which you have.

Reply via email to