mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Add more tests for completion without body.
Add tests for Fn, Const, TypeAlias without body inside Trait.
This commit is contained in:
parent
eaed19c539
commit
58136b01ba
1 changed files with 51 additions and 0 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue