diff options
author | Andrzej Janik <vosen@vosen.pl> | 2015-06-04 20:23:46 +0200 |
---|---|---|
committer | Andrzej Janik <vosen@vosen.pl> | 2015-06-04 20:23:46 +0200 |
commit | 2fcd829b1d9c70d0981411b4f4adca9124985b54 (patch) | |
tree | 1487d67764c99542b6fc7df30c60dc89719dd370 /tests | |
parent | 971700148b58df921f070015febd8706c66edded (diff) | |
download | milf-rs-2fcd829b1d9c70d0981411b4f4adca9124985b54.tar.gz milf-rs-2fcd829b1d9c70d0981411b4f4adca9124985b54.zip |
Disallow table redefinitions
Diffstat (limited to 'tests')
-rw-r--r-- | tests/valid.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/valid.rs b/tests/valid.rs index 568518b..18c21d6 100644 --- a/tests/valid.rs +++ b/tests/valid.rs @@ -32,7 +32,7 @@ fn to_json(toml: Value) -> Json { let json = Json::Array(arr.into_iter().map(to_json).collect()); if is_table {json} else {doit("array", json)} } - Table(table) => Json::Object(table.into_iter().map(|(k, v)| { + Table(table) => Json::Object(table.0.into_iter().map(|(k, v)| { (k, to_json(v)) }).collect()), } @@ -58,7 +58,7 @@ fn run(toml: &str, json: &str) { let table2 = Parser::new(&toml_string).parse().unwrap(); // floats are a little lossy - if table2.values().any(|v| v.as_float().is_some()) { return } + if table2.0.values().any(|v| v.as_float().is_some()) { return } assert_eq!(toml, Table(table2)); } |