1
0
mirror of https://github.com/bspeice/dtparse synced 2024-12-22 12:28:08 -05:00

Add a test for issue 34

This commit is contained in:
Bradlee Speice 2022-06-15 22:16:15 -04:00
parent 5b3be160f6
commit a193a79afa
2 changed files with 12 additions and 0 deletions

View File

@ -20,3 +20,6 @@ chrono = "0.4"
lazy_static = "1.1" lazy_static = "1.1"
num-traits = "0.2" num-traits = "0.2"
rust_decimal = { version = "1.17.0", default-features = false } rust_decimal = { version = "1.17.0", default-features = false }
[dev-dependencies]
base64 = "0.13"

View File

@ -1,5 +1,6 @@
use chrono::NaiveDate; use chrono::NaiveDate;
use std::collections::HashMap; use std::collections::HashMap;
use std::str;
use parse; use parse;
use ParseError; use ParseError;
@ -70,3 +71,11 @@ fn github_33() {
fn github_32() { fn github_32() {
assert_eq!(parse("99999999999999999999999"), Err(ParseError::InvalidNumeric("99999999999999999999999".to_owned()))) 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());
}