Add another test

This commit is contained in:
greg 2015-12-20 19:29:26 -08:00
parent 841b38d5b1
commit be98f8387e

View File

@ -125,5 +125,11 @@ mod tests {
let t1 = "let a = 3\n"; let t1 = "let a = 3\n";
assert_eq!(format!("{:?}", tokenize(t1)), assert_eq!(format!("{:?}", tokenize(t1)),
"[Keyword(Let), Identifier(\"a\"), Keyword(Assign), NumLiteral(3), Separator, EOF]"); "[Keyword(Let), Identifier(\"a\"), Keyword(Assign), NumLiteral(3), Separator, EOF]");
// this is intentional
let t2 = "a + b*c\n";
assert_eq!(format!("{:?}", tokenize(t2)),
"[Identifier(\"a\"), Identifier(\"+\"), Identifier(\"b*c\"), Separator, EOF]");
} }
} }