diff options
author | Alex Crichton <alex@alexcrichton.com> | 2017-02-08 21:36:38 -0800 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2017-02-08 21:36:38 -0800 |
commit | 204d1b14e6bd7b67d782def4c4c7837b9045cd8d (patch) | |
tree | 7805b214df8707f69dcd9c1daaeb87875a73c825 /tests | |
parent | 6821911bc7cebac458d2cfb2c14b8d107aa60521 (diff) | |
download | milf-rs-204d1b14e6bd7b67d782def4c4c7837b9045cd8d.tar.gz milf-rs-204d1b14e6bd7b67d782def4c4c7837b9045cd8d.zip |
Implement Deserializer::set_require_newline_after_table
Diffstat (limited to 'tests')
-rw-r--r-- | tests/backcompat.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/backcompat.rs b/tests/backcompat.rs new file mode 100644 index 0000000..33dbfa5 --- /dev/null +++ b/tests/backcompat.rs @@ -0,0 +1,14 @@ +extern crate toml; +extern crate serde; + +use serde::de::Deserialize; + +#[test] +fn main() { + assert!("[a] foo = 1".parse::<toml::Value>().is_err()); + + let mut d = toml::de::Deserializer::new("[a] foo = 1"); + d.set_require_newline_after_table(false); + let value = toml::Value::deserialize(&mut d).unwrap(); + assert_eq!(value["a"]["foo"].as_integer(), Some(1)); +} |