aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/backcompat.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/backcompat.rs b/tests/backcompat.rs
index 33dbfa5..1b3f599 100644
--- a/tests/backcompat.rs
+++ b/tests/backcompat.rs
@@ -5,10 +5,15 @@ use serde::de::Deserialize;
#[test]
fn main() {
- assert!("[a] foo = 1".parse::<toml::Value>().is_err());
+ let s = "
+ [a] foo = 1
+ [[b]] foo = 1
+ ";
+ assert!(s.parse::<toml::Value>().is_err());
- let mut d = toml::de::Deserializer::new("[a] foo = 1");
+ let mut d = toml::de::Deserializer::new(s);
d.set_require_newline_after_table(false);
let value = toml::Value::deserialize(&mut d).unwrap();
assert_eq!(value["a"]["foo"].as_integer(), Some(1));
+ assert_eq!(value["b"][0]["foo"].as_integer(), Some(1));
}