Currently tests are printed using the functions "path".
In one of my projects, I currently generate a test suite (using build.rs
) from a markdown file. The case titles in the markdown are in a "human" form with mixed capitalisation, usage of special symbols and punctuation. To produce a valid Rust function name I have to transform these titles. This unfortunately means that cargo test
s output does not quite map back to the file which means I have to do a bit of searching and approximation to figure out the mappings.
It would be great if there was a way to "override" the name printed in the test by given extra tokens to the #[test]
attribute.
e.g.
#[test(name = "My name")]
fn my_name() { }
This would greatly benefit the debugging of these tests.
test My Name ... ok
Additionally it would be great if there was a details property. This could be printed for failing tests (or under cargo test -- --verbose
) that would also help managing these generated tests.
#[test(name = "My name", details = "at ./specification.md:120")]
fn my_name() { }