Add failing tests for trait assoc method completion

This commit is contained in:
Florian Diebold 2019-10-31 20:42:57 +01:00
parent b0bf1deb7c
commit 5da941897d

View file

@ -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!(