Add test for #12372 (generate enum variant in different file)

This commit is contained in:
Amos Wenger 2022-05-25 18:18:08 +02:00
parent 0468d84564
commit 05563805b1

View File

@ -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,
}
",
)
}