From a193a79afa664e87179806f6134d392fdf890360 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Wed, 15 Jun 2022 22:16:15 -0400 Subject: [PATCH] Add a test for issue 34 --- Cargo.toml | 3 +++ src/tests/fuzzing.rs | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index c1805fa..1d4b36f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,3 +20,6 @@ chrono = "0.4" lazy_static = "1.1" num-traits = "0.2" rust_decimal = { version = "1.17.0", default-features = false } + +[dev-dependencies] +base64 = "0.13" diff --git a/src/tests/fuzzing.rs b/src/tests/fuzzing.rs index 945c517..f4b6781 100644 --- a/src/tests/fuzzing.rs +++ b/src/tests/fuzzing.rs @@ -1,5 +1,6 @@ use chrono::NaiveDate; use std::collections::HashMap; +use std::str; use parse; use ParseError; @@ -69,4 +70,12 @@ fn github_33() { #[test] fn github_32() { assert_eq!(parse("99999999999999999999999"), Err(ParseError::InvalidNumeric("99999999999999999999999".to_owned()))) +} + +#[test] +fn github_34() { + let parse_vec = base64::decode("KTMuLjYpGDYvLjZTNiouNjYuHzZpLjY/NkwuNh42Ry42PzYnKTMuNk02NjY2NjA2NjY2NjY2NjYTNjY2Ni82NjY2NlAuNlAuNlNI").unwrap(); + let parse_str = str::from_utf8(&parse_vec).unwrap(); + let parse_result = parse(parse_str); + assert!(parse_result.is_err()); } \ No newline at end of file