Add test for (generate enum variant in different 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,
+}
+
",
)
}
