Compare commits

...

4 Commits

2 changed files with 29 additions and 1 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "dtparse"
version = "1.2.0"
version = "1.3.0"
authors = ["Bradlee Speice <bradlee@speice.io>"]
description = "A dateutil-compatible timestamp parser for Rust"
repository = "https://github.com/bspeice/dtparse.git"
@ -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"

View File

@ -1,5 +1,6 @@
use chrono::NaiveDate;
use std::collections::HashMap;
use std::str;
use parse;
use ParseError;
@ -69,4 +70,28 @@ 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());
}
#[test]
fn github_35() {
let parse_vec = base64::decode("KTY6LjYqNio6KjYn").unwrap();
let parse_str = str::from_utf8(&parse_vec).unwrap();
let parse_result = parse(parse_str);
assert!(parse_result.is_err());
}
#[test]
fn github_36() {
let parse_vec = base64::decode("KTYuLg==").unwrap();
let parse_str = str::from_utf8(&parse_vec).unwrap();
let parse_result = parse(parse_str);
assert!(parse_result.is_err());
}