tests for ty

This commit is contained in:
Aleksey Kladov 2021-12-30 14:26:59 +03:00
parent 5ca83a5fb3
commit 58fa7ce782

View File

@ -37,6 +37,13 @@ fn pat() {
check_prefix(PrefixEntryPoint::Pat, ".. ..", ".. ..");
}
#[test]
fn ty() {
check_prefix(PrefixEntryPoint::Ty, "fn() foo", "fn()");
check_prefix(PrefixEntryPoint::Ty, "Clone + Copy + fn", "Clone + Copy +");
check_prefix(PrefixEntryPoint::Ty, "struct f", "struct");
}
fn check_prefix(entry: PrefixEntryPoint, input: &str, prefix: &str) {
let lexed = LexedStr::new(input);
let input = lexed.to_input();