Added escapes test

This commit is contained in:
Erin 2022-04-24 23:47:51 +02:00 committed by ondra05
parent c6f4aaef24
commit 19744aa63a

View file

@ -203,8 +203,17 @@ mod tests {
RightCurly, RightCurly,
RightCurly, RightCurly,
]; ];
let lexer = Token::lexer(code);
let result: Vec<Token> = lexer.collect(); let result: Vec<_> = Token::lexer(code).collect();
assert_eq!(result, expected);
}
#[test]
fn escapes() {
let code = r#"/*»"720B""722B""7195"«*/"#;
let expected = &[Token::String("»にゃぁ«".to_owned())];
let result: Vec<_> = Token::lexer(code).collect();
assert_eq!(result, expected); assert_eq!(result, expected);
} }
} }