test: add test case for Self

This commit is contained in:
Young-Flash 2023-12-26 21:25:30 +08:00
parent 8a0a3b2493
commit 67f001e5ec

View File

@ -451,6 +451,27 @@ mod tests {
use super::*;
#[test]
fn issue_16197() {
check_assist(
extract_struct_from_enum_variant,
r#"
enum Foo {
Bar $0{ node: Box<Self> },
Nil,
}
"#,
r#"
struct Bar{ node: Box<Foo> }
enum Foo {
Bar(Bar),
Nil,
}
"#,
);
}
#[test]
fn test_extract_struct_several_fields_tuple() {
check_assist(