mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Add test for macro expanded test module in runnables
This commit is contained in:
parent
b8507ca98d
commit
8d3a378de9
1 changed files with 50 additions and 6 deletions
|
@ -1221,15 +1221,23 @@ $0
|
||||||
macro_rules! gen {
|
macro_rules! gen {
|
||||||
() => {
|
() => {
|
||||||
#[test]
|
#[test]
|
||||||
fn foo_test() {
|
fn foo_test() {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
macro_rules! gen2 {
|
||||||
|
() => {
|
||||||
|
mod m_tests {
|
||||||
|
#[test]
|
||||||
|
fn foo_test() {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mod tests {
|
mod tests {
|
||||||
gen!();
|
gen!();
|
||||||
}
|
}
|
||||||
|
gen2!();
|
||||||
"#,
|
"#,
|
||||||
&[&TEST_MOD, &TEST],
|
&[&TEST_MOD, &TEST_MOD, &TEST, &TEST],
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
[
|
[
|
||||||
Runnable {
|
Runnable {
|
||||||
|
@ -1237,8 +1245,8 @@ mod tests {
|
||||||
file_id: FileId(
|
file_id: FileId(
|
||||||
0,
|
0,
|
||||||
),
|
),
|
||||||
full_range: 90..115,
|
full_range: 202..227,
|
||||||
focus_range: 94..99,
|
focus_range: 206..211,
|
||||||
name: "tests",
|
name: "tests",
|
||||||
kind: Module,
|
kind: Module,
|
||||||
description: "mod tests",
|
description: "mod tests",
|
||||||
|
@ -1253,8 +1261,24 @@ mod tests {
|
||||||
file_id: FileId(
|
file_id: FileId(
|
||||||
0,
|
0,
|
||||||
),
|
),
|
||||||
full_range: 106..113,
|
full_range: 228..236,
|
||||||
focus_range: 106..113,
|
focus_range: 228..236,
|
||||||
|
name: "m_tests",
|
||||||
|
kind: Module,
|
||||||
|
description: "mod m_tests",
|
||||||
|
},
|
||||||
|
kind: TestMod {
|
||||||
|
path: "m_tests",
|
||||||
|
},
|
||||||
|
cfg: None,
|
||||||
|
},
|
||||||
|
Runnable {
|
||||||
|
nav: NavigationTarget {
|
||||||
|
file_id: FileId(
|
||||||
|
0,
|
||||||
|
),
|
||||||
|
full_range: 218..225,
|
||||||
|
focus_range: 218..225,
|
||||||
name: "foo_test",
|
name: "foo_test",
|
||||||
kind: Function,
|
kind: Function,
|
||||||
},
|
},
|
||||||
|
@ -1268,6 +1292,26 @@ mod tests {
|
||||||
},
|
},
|
||||||
cfg: None,
|
cfg: None,
|
||||||
},
|
},
|
||||||
|
Runnable {
|
||||||
|
nav: NavigationTarget {
|
||||||
|
file_id: FileId(
|
||||||
|
0,
|
||||||
|
),
|
||||||
|
full_range: 228..236,
|
||||||
|
focus_range: 228..236,
|
||||||
|
name: "foo_test",
|
||||||
|
kind: Function,
|
||||||
|
},
|
||||||
|
kind: Test {
|
||||||
|
test_id: Path(
|
||||||
|
"m_tests::foo_test",
|
||||||
|
),
|
||||||
|
attr: TestAttr {
|
||||||
|
ignore: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
cfg: None,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue