Skip to content

Commit f885db8

Browse files
authored
Merge pull request RustPython#4285 from yt2b/add_test
Add test in test_numbers
2 parents 620af0a + 592e9b4 commit f885db8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/parser/src/lexer.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1389,14 +1389,17 @@ mod tests {
13891389

13901390
#[test]
13911391
fn test_numbers() {
1392-
let source = "0x2f 0b1101 0 123 123_45_67_890 0.2 2j 2.2j";
1392+
let source = "0x2f 0o12 0b1101 0 123 123_45_67_890 0.2 1e+2 2.1e3 2j 2.2j";
13931393
let tokens = lex_source(source);
13941394
assert_eq!(
13951395
tokens,
13961396
vec![
13971397
Tok::Int {
13981398
value: BigInt::from(47),
13991399
},
1400+
Tok::Int {
1401+
value: BigInt::from(10)
1402+
},
14001403
Tok::Int {
14011404
value: BigInt::from(13),
14021405
},
@@ -1410,6 +1413,8 @@ mod tests {
14101413
value: BigInt::from(1234567890),
14111414
},
14121415
Tok::Float { value: 0.2 },
1416+
Tok::Float { value: 100.0 },
1417+
Tok::Float { value: 2100.0 },
14131418
Tok::Complex {
14141419
real: 0.0,
14151420
imag: 2.0,

0 commit comments

Comments
 (0)