diff options
| author | Aleksey Kladov <aleksey.kladov@gmail.com> | 2021-12-27 20:41:17 +0300 |
|---|---|---|
| committer | Aleksey Kladov <aleksey.kladov@gmail.com> | 2021-12-28 17:00:55 +0300 |
| commit | b8b965523613022633cf91eff9c2ee724da9a6eb (patch) | |
| tree | a13ad96042eec8423aca14d47f32928994d30944 | |
| parent | f0fefde4017fa077a018c4ed03a66b5c6970fb8a (diff) | |
| download | rust-b8b965523613022633cf91eff9c2ee724da9a6eb.tar.gz rust-b8b965523613022633cf91eff9c2ee724da9a6eb.zip | |
add test
| -rw-r--r-- | crates/ide_ssr/src/tests.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/ide_ssr/src/tests.rs b/crates/ide_ssr/src/tests.rs index 028e0bec914..30eda9d56cb 100644 --- a/crates/ide_ssr/src/tests.rs +++ b/crates/ide_ssr/src/tests.rs @@ -332,6 +332,15 @@ fn ssr_struct_lit() { } #[test] +fn ssr_struct_def() { + assert_ssr_transform( + "struct Foo { $f: $t } ==>> struct Foo($t);", + r#"struct Foo { field: i32 }"#, + expect![[r#"struct Foo(i32);"#]], + ) +} + +#[test] fn ignores_whitespace() { assert_matches("1+2", "fn f() -> i32 {1 + 2}", &["1 + 2"]); assert_matches("1 + 2", "fn f() -> i32 {1+2}", &["1+2"]); |
