mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Add test for macro generated items
This commit is contained in:
parent
a70a0ca73c
commit
781b514e58
@ -865,6 +865,7 @@ fn main() {
|
||||
|
||||
#[test]
|
||||
fn whole_segment() {
|
||||
// Tests that only imports whose last segment matches the identifier get suggested.
|
||||
check_assist(
|
||||
auto_import,
|
||||
r"
|
||||
@ -883,6 +884,36 @@ fn main() {
|
||||
|
||||
struct S;
|
||||
impl fmt::Display for S {}
|
||||
",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn macro_generated() {
|
||||
// Tests that macro-generated items are suggested from external crates.
|
||||
check_assist(
|
||||
auto_import,
|
||||
r"
|
||||
//- /lib.rs crate:dep
|
||||
|
||||
macro_rules! mac {
|
||||
() => {
|
||||
pub struct Cheese;
|
||||
};
|
||||
}
|
||||
|
||||
mac!();
|
||||
|
||||
//- /main.rs crate:main deps:dep
|
||||
|
||||
fn main() {
|
||||
Cheese<|>;
|
||||
}",
|
||||
r"use dep::Cheese;
|
||||
|
||||
fn main() {
|
||||
Cheese;
|
||||
}
|
||||
",
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user