aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/backcompat.rs14
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));
+}