mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
Add failing tests for trait assoc method completion
This commit is contained in:
parent
b0bf1deb7c
commit
5da941897d
1 changed files with 60 additions and 0 deletions
|
@ -558,6 +558,66 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn completes_trait_associated_method_1() {
|
||||
assert_debug_snapshot!(
|
||||
do_reference_completion(
|
||||
"
|
||||
//- /lib.rs
|
||||
trait Trait {
|
||||
/// A trait method
|
||||
fn m();
|
||||
}
|
||||
|
||||
fn foo() { let _ = Trait::<|> }
|
||||
"
|
||||
),
|
||||
@"[]"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn completes_trait_associated_method_2() {
|
||||
assert_debug_snapshot!(
|
||||
do_reference_completion(
|
||||
"
|
||||
//- /lib.rs
|
||||
trait Trait {
|
||||
/// A trait method
|
||||
fn m();
|
||||
}
|
||||
|
||||
struct S;
|
||||
impl Trait for S {}
|
||||
|
||||
fn foo() { let _ = S::<|> }
|
||||
"
|
||||
),
|
||||
@"[]"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn completes_trait_associated_method_3() {
|
||||
assert_debug_snapshot!(
|
||||
do_reference_completion(
|
||||
"
|
||||
//- /lib.rs
|
||||
trait Trait {
|
||||
/// A trait method
|
||||
fn m();
|
||||
}
|
||||
|
||||
struct S;
|
||||
impl Trait for S {}
|
||||
|
||||
fn foo() { let _ = <S as Trait>::<|> }
|
||||
"
|
||||
),
|
||||
@"[]"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn completes_type_alias() {
|
||||
assert_debug_snapshot!(
|
||||
|
|
Loading…
Reference in a new issue