mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-15 22:54:00 +00:00
test: add test case for Self
This commit is contained in:
parent
8a0a3b2493
commit
67f001e5ec
1 changed files with 21 additions and 0 deletions
|
@ -451,6 +451,27 @@ mod tests {
|
||||||
|
|
||||||
use super::*;
|
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]
|
#[test]
|
||||||
fn test_extract_struct_several_fields_tuple() {
|
fn test_extract_struct_several_fields_tuple() {
|
||||||
check_assist(
|
check_assist(
|
||||||
|
|
Loading…
Reference in a new issue