Skip to content

Commit

Permalink
Add test for rust-lang#12372 (generate enum variant in different file)
Browse files Browse the repository at this point in the history
  • Loading branch information
fasterthanlime committed May 25, 2022
1 parent 0468d84 commit 0556380
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions crates/ide-assists/src/handlers/generate_enum_variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
",
)
}
Expand Down

0 comments on commit 0556380

Please sign in to comment.