pub trait TestId:
Copy
+ Debug
+ 'static {
// Required methods
fn test_id(&self) -> Cow<'static, str>;
fn rust_path(&self) -> &'static str;
// Provided method
fn qualified_path(&self) -> &'static str { ... }
}Expand description
A test id the view and the tests name with the same value, so a typo does not compile.
Derive it on an enum with #[derive(TestId)]: unit variants become their name in kebab
case, and #[test_id("delete-{0}")] sets a string or a format string over the fields.
Required Methods§
Provided Methods§
Sourcefn qualified_path(&self) -> &'static str
fn qualified_path(&self) -> &'static str
The variant’s path from its crate root, such as todo::ui::Ids::Delete, which the
raw tree reports so the recorder can name the variant from a test. The derive builds it
with module_path!(); an impl written by hand gives rust_path.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".