mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 15:32:06 +00:00
Add test for #12372 (generate enum variant in different file)
This commit is contained in:
parent
0468d84564
commit
05563805b1
@ -136,6 +136,43 @@ enum Foo {
|
||||
fn main() {
|
||||
Foo::Baz
|
||||
}
|
||||
",
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn generate_basic_enum_variant_in_different_file() {
|
||||
check_assist(
|
||||
generate_enum_variant,
|
||||
r"
|
||||
//- /main.rs
|
||||
mod foo;
|
||||
use foo::Foo;
|
||||
|
||||
fn main() {
|
||||
Foo::Baz$0
|
||||
}
|
||||
|
||||
//- /foo.rs
|
||||
enum Foo {
|
||||
Bar,
|
||||
}
|
||||
",
|
||||
r"
|
||||
//- /main.rs
|
||||
mod foo;
|
||||
use foo::Foo;
|
||||
|
||||
fn main() {
|
||||
Foo::Baz
|
||||
}
|
||||
|
||||
//- /foo.rs
|
||||
enum Foo {
|
||||
Bar,
|
||||
Baz,
|
||||
}
|
||||
|
||||
",
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user