Subject: | Failing subtest within a subtest within a TODO puts errors to the screen |
A failing subtest within a subtest within a TODO will emit the failures on prove. I would expect all the diagnostics for the failures to be hidden, but the nested ones make their way out to the user. The test passes overall, but has messy diagnostics that we don't want to see.
The horse/sheep mismatch is suppressed correctly, but the cow/pig mismatch goes to the screen.
$ cat foo.t
use warnings;
use strict;
use Test::More 'no_plan';
diag "Perl $], Test::More $Test::More::VERSION\n";
TODO: {
local $TODO = 'Have not changed laws of biology';
subtest 'Farm animals' => sub {
is( 'horse', 'sheep', 'Horses and sheep are the same' );
subtest 'Barn animals' => sub {
is( 'cow', 'pig', 'Cows and pigs are the same' );
};
is( 'duck', 'goose', 'Duck and goose are the same' );
};
}
$ prove foo.t
[16:04:05] foo.t .. # Perl 5.020003, Test::More 1.302015
# Failed test 'Cows and pigs are the same'
# at foo.t line 13.
# got: 'cow'
# expected: 'pig'
# Looks like you failed 1 test of 1.
[16:04:05] foo.t .. ok 63 ms ( 0.00 usr 0.00 sys + 0.06 cusr 0.00 csys = 0.06 CPU)
[16:04:05]
All tests successful.
Files=1, Tests=1, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.06 cusr 0.00 csys = 0.09 CPU)
Result: PASS
$ prove --version
TAP::Harness v3.36 and Perl v5.20.3