Add a few more tests for redefining tables

This commit is contained in:
Alex Crichton 2015-06-07 23:46:02 -07:00
parent 88461157f2
commit 00baf76107

View file

@ -1381,14 +1381,29 @@ trimmed in raw strings.
#[test] #[test]
fn bad_table_redefine() { fn bad_table_redefine() {
let mut p = Parser::new(" bad!("
[a] [a]
foo=\"bar\" foo=\"bar\"
[a.b] [a.b]
foo=\"bar\" foo=\"bar\"
[a] [a]
baz=\"bar\" ", "redefinition of table `a`");
"); bad!("
assert!(p.parse().is_none()); [a]
foo=\"bar\"
b = { foo = \"bar\" }
[a]
", "redefinition of table `a`");
bad!("
[a]
b = {}
[a.b]
", "redefinition of table `b`");
bad!("
[a]
b = {}
[a]
", "redefinition of table `a`");
} }
} }