aboutsummaryrefslogtreecommitdiff
path: root/test-suite/tests
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-07-11 09:05:26 -0500
committerGitHub <noreply@github.com>2018-07-11 09:05:26 -0500
commit2a24f054f0f51974ffe08d67052318586716d925 (patch)
tree9bc1664b7c8ecc01b073925e2215095785a8231f /test-suite/tests
parent1ed9b1ddd4b596fc7aa928a372fefe9d7908326a (diff)
parent1e51ec77a0d15d25319636cc589f5930a68a1dee (diff)
downloadmilf-rs-2a24f054f0f51974ffe08d67052318586716d925.tar.gz
milf-rs-2a24f054f0f51974ffe08d67052318586716d925.zip
Merge pull request #251 from ehuss/datetime-space
0.5: Support space separator in datetime.
Diffstat (limited to 'test-suite/tests')
-rw-r--r--test-suite/tests/datetime.rs8
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");