1
0
mirror of https://github.com/bspeice/dtparse synced 2026-09-14 04:43:02 -04:00

4 Commits

Author SHA1 Message Date
bspeice ed919e84ef #38: Release new dateutil version 2022-06-15 22:21:25 -04:00
bspeice 4d8ade4b05 #36: Add test to assert no longer panics 2022-06-15 22:20:37 -04:00
bspeice 6a88885ef5 #35: Add test to make sure it does not panic 2022-06-15 22:18:20 -04:00
bspeice a193a79afa Add a test for issue 34 2022-06-15 22:16:15 -04:00
2 changed files with 29 additions and 1 deletions
+4 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "dtparse" name = "dtparse"
version = "1.2.0" version = "1.3.0"
authors = ["Bradlee Speice <bradlee@speice.io>"] authors = ["Bradlee Speice <bradlee@speice.io>"]
description = "A dateutil-compatible timestamp parser for Rust" description = "A dateutil-compatible timestamp parser for Rust"
repository = "https://github.com/bspeice/dtparse.git" repository = "https://github.com/bspeice/dtparse.git"
@@ -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"
+25
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;
@@ -69,4 +70,28 @@ fn github_33() {
#[test] #[test]
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());
}
#[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());
} }