mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Add completion tests for cursor after items
This commit is contained in:
parent
55d4813561
commit
5012fa2dd4
@ -80,6 +80,72 @@ fn after_target_name_in_impl() {
|
|||||||
check(r"impl Trait for Type $0", expect![[r#""#]]);
|
check(r"impl Trait for Type $0", expect![[r#""#]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn after_struct_name() {
|
||||||
|
// FIXME: This should emit `kw where` only
|
||||||
|
check(
|
||||||
|
r"struct Struct $0",
|
||||||
|
expect![[r##"
|
||||||
|
kw pub(crate)
|
||||||
|
kw pub
|
||||||
|
kw unsafe
|
||||||
|
kw fn
|
||||||
|
kw const
|
||||||
|
kw type
|
||||||
|
kw impl
|
||||||
|
kw extern
|
||||||
|
kw use
|
||||||
|
kw trait
|
||||||
|
kw static
|
||||||
|
kw mod
|
||||||
|
kw enum
|
||||||
|
kw struct
|
||||||
|
kw union
|
||||||
|
sn tmod (Test module)
|
||||||
|
sn tfn (Test function)
|
||||||
|
sn macro_rules
|
||||||
|
kw self
|
||||||
|
kw super
|
||||||
|
kw crate
|
||||||
|
md module
|
||||||
|
ma makro!(…) #[macro_export] macro_rules! makro
|
||||||
|
"##]],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn after_fn_name() {
|
||||||
|
// FIXME: This should emit `kw where` only
|
||||||
|
check(
|
||||||
|
r"fn func() $0",
|
||||||
|
expect![[r##"
|
||||||
|
kw pub(crate)
|
||||||
|
kw pub
|
||||||
|
kw unsafe
|
||||||
|
kw fn
|
||||||
|
kw const
|
||||||
|
kw type
|
||||||
|
kw impl
|
||||||
|
kw extern
|
||||||
|
kw use
|
||||||
|
kw trait
|
||||||
|
kw static
|
||||||
|
kw mod
|
||||||
|
kw enum
|
||||||
|
kw struct
|
||||||
|
kw union
|
||||||
|
sn tmod (Test module)
|
||||||
|
sn tfn (Test function)
|
||||||
|
sn macro_rules
|
||||||
|
kw self
|
||||||
|
kw super
|
||||||
|
kw crate
|
||||||
|
md module
|
||||||
|
ma makro!(…) #[macro_export] macro_rules! makro
|
||||||
|
"##]],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn before_record_field() {
|
fn before_record_field() {
|
||||||
check(
|
check(
|
||||||
|
Loading…
Reference in New Issue
Block a user