Skip to content

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

@plicease

Description

@plicease

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions