Test-More / Test2-Harness

Alternative to Test::Harness
Other
23 stars 26 forks source link

TAP parsing + Buffered subtests seems to have a flaw #216

Open exodist opened 3 years ago

exodist commented 3 years ago
# HARNESS-NO-STREAM
use Test2::V0;
use Test2::Tools::Subtest qw/subtest_streamed subtest_buffered/;

ok(1, "An ok");
diag "A Diag";
note "A Note";

subtest_streamed streamed => sub {
    ok(1, "streamed ok");
};

subtest_buffered buffered => sub {
    ok(1, "buffered ok");
};

done_testing;
( LAUNCH )  job  1    demo/tap/tap.t
(  NOTE  )  job  1    Seeded srand with seed '20210309' from local date.
[  PASS  ]  job  1  + An ok
(  NOTE  )  job  1    A Note
(  NOTE  )  job  1    Subtest: streamed
[  PASS  ]  job  1  +~Subtest: streamed
[  PASS  ]  job  1    + streamed ok
[  PLAN  ]  job  1    | Expected assertions: 1
            job  1    ^
[  PASS  ]  job  1  +~buffered
[  PASS  ]  job  1  +~buffered
[  PLAN  ]  job  1    Expected assertions: 3
(  NOTE  )  job  1    rss:  22732kB
(  NOTE  )  job  1    size: 31124kB
(  NOTE  )  job  1    peak: 31124kB
(  DIAG  )  job  1    A Diag
( PASSED )  job  1    demo/tap/tap.t
(  TIME  )  job  1    Startup: 0.01399s | Events: 0.00000s | Cleanup: 0.02992s | Total: 0.04391s

Notice that 'buffered' is displayed twice, and the nested events are not seen. The event log also has 'buffered' twice.