diff options
| author | Duong Quoc Khanh <dqkqdlot@gmail.com> | 2023-02-09 17:32:55 +0900 |
|---|---|---|
| committer | Duong Quoc Khanh <dqkqdlot@gmail.com> | 2023-02-09 17:32:55 +0900 |
| commit | 58136b01ba0cc0c2f598c300db3cc864fcb09f1f (patch) | |
| tree | a56871c044a05b36b68a9d4f6288601d1fc02798 | |
| parent | eaed19c5399064393e846ad5dddd7b0b290d2582 (diff) | |
| download | rust-58136b01ba0cc0c2f598c300db3cc864fcb09f1f.tar.gz rust-58136b01ba0cc0c2f598c300db3cc864fcb09f1f.zip | |
Add more tests for completion without body.
Add tests for Fn, Const, TypeAlias without body inside Trait.
| -rw-r--r-- | crates/ide-completion/src/tests/item_list.rs | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/crates/ide-completion/src/tests/item_list.rs b/crates/ide-completion/src/tests/item_list.rs index b62b988885d..9fc731bb11d 100644 --- a/crates/ide-completion/src/tests/item_list.rs +++ b/crates/ide-completion/src/tests/item_list.rs @@ -215,6 +215,57 @@ fn in_trait_assoc_item_list() { } #[test] +fn in_trait_assoc_fn_missing_body() { + check( + r#"trait Foo { fn function(); $0 }"#, + expect![[r#" + ma makro!(…) macro_rules! makro + md module + kw const + kw crate:: + kw fn + kw self:: + kw type + kw unsafe + "#]], + ); +} + +#[test] +fn in_trait_assoc_const_missing_body() { + check( + r#"trait Foo { const CONST: (); $0 }"#, + expect![[r#" + ma makro!(…) macro_rules! makro + md module + kw const + kw crate:: + kw fn + kw self:: + kw type + kw unsafe + "#]], + ); +} + +#[test] +fn in_trait_assoc_type_aliases_missing_ty() { + check( + r#"trait Foo { type Type; $0 }"#, + expect![[r#" + ma makro!(…) macro_rules! makro + md module + kw const + kw crate:: + kw fn + kw self:: + kw type + kw unsafe + "#]], + ); +} + +#[test] fn in_trait_impl_assoc_item_list() { check( r#" |
