Steps to reproduce
cargo new reproducer && cd reproducer && cargo add --dev rstest
main.rs
fn main() {
println!("Hello, world!");
}
#[cfg(test)]
mod test {
use rstest::rstest;
use std::path::PathBuf;
#[rstest]
fn wrong_testname(#[files("src/main.rs")] _p: PathBuf) {}
}
- Run this test on Linux & Windows. Compare names of the generated test cases.
Expected output
cargo test
running 1 test
test test::wrong_testname::_p_1_src_main_rs ... ok
This is what happens when running on Linux.
Actual output
However, when running on Windows 11, this happens:
cargo test
running 1 test
test test::wrong_testname::_p_1__UP_D_Rust_projectsreproducersrcmain_rs ... ok
The test seems to use the full path up from the drive's root, not from the crate's base directory. It is also missing some _ in place of path separators.
Steps to reproduce
cargo new reproducer && cd reproducer && cargo add --dev rstestmain.rsExpected output
cargo testThis is what happens when running on Linux.
Actual output
However, when running on Windows 11, this happens:
cargo testThe test seems to use the full path up from the drive's root, not from the crate's base directory. It is also missing some _ in place of path separators.