frondeus / frondeus/test-case

`test-env-log` used with `test-case` creates test duplicates

Open
#101 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
633
Forks
42
PR merge metrics
No merged PRs in 30d

Description

> When I use the latest `test-case` and `test-log` (new name of `test-env-log`) together, I get duplicate copies of each test generated.
I also tried it with what I think were the versions from when this issue was created and have the same problem.

[Full example in this gist](https://gist.github.com/newsch/6ec5dfc835c355f7943f55d9c01d88f6#file-main-rs=)

```rust
#[cfg(test)]
mod tests {
use test_case::test_case;

#[test_case(0, 0 ; "the same")]
#[test_case(0, 1 ; "different")]
#[test_log::test]
// #[test_env_log::test]
fn equality(a: usize, b: usize) {
log::info!("a: {}", a);
log::info!("b: {}", b);
assert_eq!(a, b)
}
}
```

Output

```
running 4 tests
test tests::equality::the_same ... ok
test tests::equality::the_same ... ok
test tests::equality::different ... FAILED
test tests::equality::different ... FAILED

failures:

---- tests::equality::different stdout ----
thread 'tests::equality::different' panicked at 'assertion failed: `(left == right)`
left: `0`,
right: `1`', main.rs:18:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- tests::equality::different stdout ----
thread 'tests::equality::different' panicked at 'assertion failed: `(left == right)`
left: `0`,
right: `1`', main.rs:18:9

failures:
tests::equality::different
tests::equality::different

test result: FAILED. 2 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed, to rerun pass '--bin main'
```

_Originally posted by @newsch in https://github.com/frondeus/test-case/issues/69#issuecomment-1167442635_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.