Add more tests for completion without body.

Add tests for Fn, Const, TypeAlias without body inside Trait.
This commit is contained in:
Duong Quoc Khanh 2023-02-09 17:32:55 +09:00
parent eaed19c539
commit 58136b01ba
No known key found for this signature in database
GPG Key ID: DA52A74E804A00E7

View File

@ -214,6 +214,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(