diff options
author | Eric Huss <eric@huss.org> | 2018-07-10 17:14:16 -0700 |
---|---|---|
committer | Eric Huss <eric@huss.org> | 2018-07-10 17:14:16 -0700 |
commit | 1e51ec77a0d15d25319636cc589f5930a68a1dee (patch) | |
tree | 82dcab23f07b34f8cdc957ac5fdf9073e11566ee /test-suite | |
parent | 2be7ce9079fa02d9dd42958410ba1c40cef9811c (diff) | |
download | milf-rs-1e51ec77a0d15d25319636cc589f5930a68a1dee.tar.gz milf-rs-1e51ec77a0d15d25319636cc589f5930a68a1dee.zip |
0.5: Support space separate in datetime.
cc #224
Diffstat (limited to 'test-suite')
-rw-r--r-- | test-suite/tests/datetime.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test-suite/tests/datetime.rs b/test-suite/tests/datetime.rs index 948e863..f3b77e3 100644 --- a/test-suite/tests/datetime.rs +++ b/test-suite/tests/datetime.rs @@ -6,10 +6,14 @@ use toml::Value; #[test] fn times() { - fn good(s: &str) { + fn dogood(s: &str, serialized: &str) { let to_parse = format!("foo = {}", s); let value = Value::from_str(&to_parse).unwrap(); - assert_eq!(value["foo"].as_datetime().unwrap().to_string(), s); + assert_eq!(value["foo"].as_datetime().unwrap().to_string(), serialized); + } + fn good(s: &str) { + dogood(s, s); + dogood(&s.replace("T", " "), s); } good("1997-09-09T09:09:09Z"); |