From 19744aa63a2ac1b2f4f74d60894bf2847e1076e8 Mon Sep 17 00:00:00 2001 From: Erin Date: Sun, 24 Apr 2022 23:47:51 +0200 Subject: [PATCH] Added escapes test --- ablescript/src/lexer.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ablescript/src/lexer.rs b/ablescript/src/lexer.rs index 61da475..c6b6e67 100644 --- a/ablescript/src/lexer.rs +++ b/ablescript/src/lexer.rs @@ -203,8 +203,17 @@ mod tests { RightCurly, RightCurly, ]; - let lexer = Token::lexer(code); - let result: Vec = 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); } }