Test-More / Test-Stream

DEPRECATED see test2
3 stars 5 forks source link

subtest plan count mismatch error not as obvious as Test::More #83

Open plicease opened 8 years ago

plicease commented 8 years ago

Consider a subtest with the wrong number of tests:

urquhart% perl -Ilib t/example1.t 
1..1
not ok 1 - foo {
# Failed test 'foo'
# at t/example1.t line 13.
    1..2
    ok 1
    ok 2
    ok 3
}

The subtest fails, but doesn't indicate WHY it failed, as Test::More does:

urquhart% perl -Ilib t/example2.t
1..1
    # Subtest: foo
    1..2
    ok 1
    ok 2
    ok 3
    # Looks like you planned 2 tests but ran 3.
not ok 1 - foo
#   Failed test 'foo'
#   at t/example2.t line 13.
# Looks like you failed 1 test of 1.

Also, a Test::Stream non subtest plan mismatches provides a diagnostic:

urquhart% perl -Ilib t/example3.t
1..2
ok 1
ok 2
ok 3
# Did not follow plan: expected 2, ran 3.
exodist commented 8 years ago

Thanks for the report. There is some codebase flux right now, but this will be addressed.