frondeus / frondeus/test-case

Duplicated tests when combined with `test_log`

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

Description

It's unclear to me if this is really a bug or just the expected outcome of Rust's weird test case registration system.

```
❯❯ cat Cargo.toml
[package]
name = "t"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
test-case = "3.3.1"
test-log = "0.2.16"

[[bin]]
name = "t"
path = "main.rs"

❯❯ cat main.rs
fn main() {
println!("Hello, world!");
}

mod tests {
use test_case::test_case;
use test_log;

#[test_case(1; "pollo mundo")]
#[test_log::test]
fn test_once(_arg: u8) {
assert!(true);
}
}

❯❯ cargo test
Finished test [unoptimized + debuginfo] target(s) in 0.02s
Running unittests main.rs (target/debug/deps/t-fe670cbfe3e221f9)

running 2 tests
test tests::test_once::pollo_mundo ... ok
test tests::test_once::pollo_mundo ... ok

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

Any idea if there's a workaround for that? In this case it's quite easy to drop `test_log` but I guess there might be many similar cases where the test wrapper macro is more valuable.

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.