Skip to content

Commit d947398

Browse files
committed
fix(test2): Capture names as full paths
1 parent 63e8214 commit d947398

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

crates/libtest2/src/macros.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ macro_rules! _test_parse {
110110
fn name(&self) -> &str {
111111
$crate::_private::push!(crate::TESTS, _: $crate::_private::DynCase = $crate::_private::DynCase(&$name));
112112

113-
stringify!($name)
113+
const FULL_PATH: &str = concat!(std::module_path!(), "::", stringify!($name));
114+
let i = FULL_PATH.find("::").expect("we have inserted this in the line above so it must be there");
115+
&FULL_PATH[(i+2)..]
114116
}
115117
fn kind(&self) -> $crate::_private::TestKind {
116118
Default::default()

0 commit comments

Comments
 (0)