From 592e9b49b791dfb8480aa0b292efafa19814fac2 Mon Sep 17 00:00:00 2001 From: yt2b Date: Mon, 21 Nov 2022 22:36:05 +0900 Subject: [PATCH] Add test --- compiler/parser/src/lexer.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/parser/src/lexer.rs b/compiler/parser/src/lexer.rs index 7bf88851cf..62bc4ca325 100644 --- a/compiler/parser/src/lexer.rs +++ b/compiler/parser/src/lexer.rs @@ -1389,7 +1389,7 @@ mod tests { #[test] fn test_numbers() { - let source = "0x2f 0b1101 0 123 123_45_67_890 0.2 2j 2.2j"; + let source = "0x2f 0o12 0b1101 0 123 123_45_67_890 0.2 1e+2 2.1e3 2j 2.2j"; let tokens = lex_source(source); assert_eq!( tokens, @@ -1397,6 +1397,9 @@ mod tests { Tok::Int { value: BigInt::from(47), }, + Tok::Int { + value: BigInt::from(10) + }, Tok::Int { value: BigInt::from(13), }, @@ -1410,6 +1413,8 @@ mod tests { value: BigInt::from(1234567890), }, Tok::Float { value: 0.2 }, + Tok::Float { value: 100.0 }, + Tok::Float { value: 2100.0 }, Tok::Complex { real: 0.0, imag: 2.0,