Skip to content

Commit 75d7da1

Browse files
bors[bot]Veykril
andauthored
Merge #9683
9683: internal: Move out expression based `unqualified_path` completion tests r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <[email protected]>
2 parents 6494193 + 189440c commit 75d7da1

File tree

11 files changed

+430
-571
lines changed

11 files changed

+430
-571
lines changed

crates/ide_completion/src/completions/qualified_path.rs

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -255,60 +255,6 @@ mod tests {
255255
expect.assert_eq(&actual);
256256
}
257257

258-
fn check_builtin(ra_fixture: &str, expect: Expect) {
259-
let actual = filtered_completion_list(ra_fixture, CompletionKind::BuiltinType);
260-
expect.assert_eq(&actual);
261-
}
262-
263-
#[test]
264-
fn dont_complete_primitive_in_use() {
265-
check_builtin(r#"use self::$0;"#, expect![[""]]);
266-
}
267-
268-
#[test]
269-
fn dont_complete_primitive_in_module_scope() {
270-
check_builtin(r#"fn foo() { self::$0 }"#, expect![[""]]);
271-
}
272-
273-
#[test]
274-
fn completes_enum_variant() {
275-
check(
276-
r#"
277-
enum E { Foo, Bar(i32) }
278-
fn foo() { let _ = E::$0 }
279-
"#,
280-
expect![[r#"
281-
ev Foo ()
282-
ev Bar(…) (i32)
283-
"#]],
284-
);
285-
}
286-
287-
#[test]
288-
fn completes_struct_associated_items() {
289-
check(
290-
r#"
291-
//- /lib.rs
292-
struct S;
293-
294-
impl S {
295-
fn a() {}
296-
fn b(&self) {}
297-
const C: i32 = 42;
298-
type T = i32;
299-
}
300-
301-
fn foo() { let _ = S::$0 }
302-
"#,
303-
expect![[r#"
304-
fn a() fn()
305-
me b(…) fn(&self)
306-
ct C const C: i32 = 42;
307-
ta T type T = i32;
308-
"#]],
309-
);
310-
}
311-
312258
#[test]
313259
fn associated_item_visibility() {
314260
check(
@@ -336,21 +282,6 @@ fn foo() { let _ = S::$0 }
336282
);
337283
}
338284

339-
#[test]
340-
fn completes_enum_associated_method() {
341-
check(
342-
r#"
343-
enum E {};
344-
impl E { fn m() { } }
345-
346-
fn foo() { let _ = E::$0 }
347-
"#,
348-
expect![[r#"
349-
fn m() fn()
350-
"#]],
351-
);
352-
}
353-
354285
#[test]
355286
fn completes_union_associated_method() {
356287
check(

crates/ide_completion/src/completions/record.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ pub(crate) fn complete_record(acc: &mut Completions, ctx: &CompletionContext) ->
4747

4848
#[cfg(test)]
4949
mod tests {
50-
5150
use crate::tests::check_edit;
5251

5352
#[test]

crates/ide_completion/src/completions/snippet.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -86,26 +86,3 @@ fn ${1:feature}() {
8686
let item = snippet(ctx, cap, "macro_rules", "macro_rules! $1 {\n\t($2) => {\n\t\t$0\n\t};\n}");
8787
item.add_to(acc);
8888
}
89-
90-
#[cfg(test)]
91-
mod tests {
92-
use expect_test::{expect, Expect};
93-
94-
use crate::{tests::filtered_completion_list, CompletionKind};
95-
96-
fn check(ra_fixture: &str, expect: Expect) {
97-
let actual = filtered_completion_list(ra_fixture, CompletionKind::Snippet);
98-
expect.assert_eq(&actual)
99-
}
100-
101-
#[test]
102-
fn completes_snippets_in_expressions() {
103-
check(
104-
r#"fn foo(x: i32) { $0 }"#,
105-
expect![[r#"
106-
sn pd
107-
sn ppd
108-
"#]],
109-
);
110-
}
111-
}

0 commit comments

Comments
 (0)