test for the various kinds of ids

This commit is contained in:
Niko Matsakis 2015-07-19 14:08:27 -04:00
parent 4c74cc6873
commit 09f00f7a56

View File

@ -63,3 +63,18 @@ fn code_forgot_comma() {
// intentionally forget the comma token; this is more of a test of `test`
]);
}
#[test]
fn various_kinds_of_ids() {
test("foo<T<'a,U>>", vec![
("~~~ ", MacroId("foo")),
(" ~ ", LessThan),
(" ~ ", MacroId("T")),
(" ~ ", LessThan),
(" ~~ ", Lifetime("'a")),
(" ~ ", Comma),
(" ~ ", Id("U")),
(" ~ ", GreaterThan),
(" ~", GreaterThan),
]);
}