mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
add path tests
This commit is contained in:
parent
287e748aa9
commit
7c4276b3e1
1 changed files with 10 additions and 0 deletions
|
@ -53,6 +53,16 @@ fn expr() {
|
||||||
check_prefix(PrefixEntryPoint::Expr, "#[attr] ()", "#[attr] ()");
|
check_prefix(PrefixEntryPoint::Expr, "#[attr] ()", "#[attr] ()");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn path() {
|
||||||
|
check_prefix(PrefixEntryPoint::Path, "foo::bar baz", "foo::bar");
|
||||||
|
check_prefix(PrefixEntryPoint::Path, "foo::<> baz", "foo::<>");
|
||||||
|
check_prefix(PrefixEntryPoint::Path, "foo<> baz", "foo<>");
|
||||||
|
check_prefix(PrefixEntryPoint::Path, "Fn() -> i32?", "Fn() -> i32");
|
||||||
|
// FIXME: this shouldn't be accepted as path actually.
|
||||||
|
check_prefix(PrefixEntryPoint::Path, "<_>::foo", "<_>::foo");
|
||||||
|
}
|
||||||
|
|
||||||
fn check_prefix(entry: PrefixEntryPoint, input: &str, prefix: &str) {
|
fn check_prefix(entry: PrefixEntryPoint, input: &str, prefix: &str) {
|
||||||
let lexed = LexedStr::new(input);
|
let lexed = LexedStr::new(input);
|
||||||
let input = lexed.to_input();
|
let input = lexed.to_input();
|
||||||
|
|
Loading…
Reference in a new issue