Alexhuszagh / minimal-lexical

Minimal float parser primitives with a focus on compile times.
Other
20 stars 5 forks source link

[BUG] Potencial substraction overflow #13

Open NEUZhangy opened 2 years ago

NEUZhangy commented 2 years ago

Rust version: rustc 1.58.1 (db9d1b20b 2022-01-20)

Test case

add test for src/parser.rs::parse_number

[test]

fn test_parse() { let mut integer = vec![0u8]; let mut fraction = vec![0u8]; let data = 1; let mut rdr = parse_number(integer.iter(), fraction.iter(), data); } error infor: thread 'parse::test_parse' panicked at 'attempt to subtract with overflow', src/parse.rs:44:21 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace