Subject: | false negative tests |
example.t:
#!/usr/bin/perl
use Test::More tests => 2;
ok(1 + 1 == 2);
print "Test1";
is(1 + 1,2);
test_harness.pl:
#!/usr/bin/perl
use Test::Harness qw(execute_tests);
my @files = qw(example.t);
my ($all,$failed,$todo) = execute_tests(tests => \@files);
for my $script(keys %$failed){
print "In ",$script,
" these tests failed: ",
$failed->{$script}->{canon},"\n";
}
Output:
example....FAILED test 2
Failed 1/2 tests, 50.00% okay
In example.t these tests failed: 2
If I add a "\n" to the print-statement it works fine:
#!/usr/bin/perl
use Test::More tests => 2;
ok(1 + 1 == 2);
print "Test1\n";
is(1 + 1,2);
Output:
harness_bsp....ok