Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 58136b0

Browse files
committed
Add more tests for completion without body.
Add tests for Fn, Const, TypeAlias without body inside Trait.
1 parent eaed19c commit 58136b0

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

crates/ide-completion/src/tests/item_list.rs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,57 @@ fn in_trait_assoc_item_list() {
214214
);
215215
}
216216

217+
#[test]
218+
fn in_trait_assoc_fn_missing_body() {
219+
check(
220+
r#"trait Foo { fn function(); $0 }"#,
221+
expect![[r#"
222+
ma makro!(…) macro_rules! makro
223+
md module
224+
kw const
225+
kw crate::
226+
kw fn
227+
kw self::
228+
kw type
229+
kw unsafe
230+
"#]],
231+
);
232+
}
233+
234+
#[test]
235+
fn in_trait_assoc_const_missing_body() {
236+
check(
237+
r#"trait Foo { const CONST: (); $0 }"#,
238+
expect![[r#"
239+
ma makro!(…) macro_rules! makro
240+
md module
241+
kw const
242+
kw crate::
243+
kw fn
244+
kw self::
245+
kw type
246+
kw unsafe
247+
"#]],
248+
);
249+
}
250+
251+
#[test]
252+
fn in_trait_assoc_type_aliases_missing_ty() {
253+
check(
254+
r#"trait Foo { type Type; $0 }"#,
255+
expect![[r#"
256+
ma makro!(…) macro_rules! makro
257+
md module
258+
kw const
259+
kw crate::
260+
kw fn
261+
kw self::
262+
kw type
263+
kw unsafe
264+
"#]],
265+
);
266+
}
267+
217268
#[test]
218269
fn in_trait_impl_assoc_item_list() {
219270
check(

0 commit comments

Comments
 (0)