From 204d1b14e6bd7b67d782def4c4c7837b9045cd8d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 8 Feb 2017 21:36:38 -0800 Subject: Implement Deserializer::set_require_newline_after_table --- tests/backcompat.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/backcompat.rs (limited to 'tests') 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::().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)); +} -- cgit v1.2.3