Add multi file test for "Convert to named struct" assist

This commit is contained in:
unexge 2021-04-21 16:20:08 +03:00
parent 96d694062b
commit 6630266ce1

View File

@ -384,6 +384,39 @@ fn into_second(self) -> u64 {
);
}
#[test]
fn convert_struct_with_multi_file_references() {
check_assist(
convert_tuple_struct_to_named_struct,
r#"
//- /main.rs
struct Inner;
struct A$0(Inner);
mod foo;
//- /foo.rs
use crate::{A, Inner};
fn f() {
let a = A(Inner);
}
"#,
r#"
//- /main.rs
struct Inner;
struct A { field1: Inner }
mod foo;
//- /foo.rs
use crate::{A, Inner};
fn f() {
let a = A { field1: Inner };
}
"#,
);
}
#[test]
fn convert_struct_with_where_clause() {
check_assist(