Skip to content

Non-unique test names yield incorrect test output #166

Description

@skogseth

The following code

#[libtest2::main]
fn main() {}

#[libtest2::test]
fn foo(_: &libtest2::TestContext) {}

mod inner {
    #[libtest2::test]
    fn foo(_: &libtest2::TestContext) {}
}

gives the output

running 2 tests
test foo ... ok
test foo ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out; finished in 0.000s

The number of tests that passed is incorrectly listed as "1".

The changes in #165 will make this impossible to reproduce using the macros, as they will always give unique test names, but the issue will still remain with the "normal API".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-harnessArea: core test harnessC-bugCategory: Things not working as expected

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions