[lexer] Identify delimiters and emit numbers
This commit is contained in:
parent
853312ce67
commit
569fe82c1a
2 changed files with 9 additions and 5 deletions
|
@ -75,8 +75,9 @@ fn bool_with_spaces() {
|
|||
|
||||
#[test]
|
||||
fn integer() {
|
||||
let expected_lex = Lex::new(Token::Num(23), "23", 0, 0);
|
||||
let mut lex = Lexer::new("23".chars());
|
||||
assert_eq!(lex.next(), Some(Ok(expected_lex)));
|
||||
let mut lex = Lexer::new("23 42".chars());
|
||||
assert_eq!(lex.next(), Some(Ok(Lex::new(Token::Num(23), "23", 0, 0))));
|
||||
// TODO: Fix this once issue #12 is fixed.
|
||||
assert_eq!(lex.next(), Some(Ok(Lex::new(Token::Num(42), " 42", 0, 0))));
|
||||
assert_eq!(lex.next(), None);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue