aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-06-07 23:46:02 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-06-07 23:58:45 -0700
commit00baf76107ed8c40c3b96dcc191277dfaab82ca1 (patch)
tree1ba84dfdd5cc083797e1f4a5a2659fecc725c2dd /src
parent88461157f267cbc4b4ee1352ed225667d4acc466 (diff)
downloadmilf-rs-00baf76107ed8c40c3b96dcc191277dfaab82ca1.tar.gz
milf-rs-00baf76107ed8c40c3b96dcc191277dfaab82ca1.zip
Add a few more tests for redefining tables
Diffstat (limited to 'src')
-rw-r--r--src/parser.rs23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/parser.rs b/src/parser.rs
index b37621a..68fa546 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -1381,14 +1381,29 @@ trimmed in raw strings.
#[test]
fn bad_table_redefine() {
- let mut p = Parser::new("
+ bad!("
[a]
foo=\"bar\"
[a.b]
foo=\"bar\"
[a]
- baz=\"bar\"
- ");
- assert!(p.parse().is_none());
+ ", "redefinition of table `a`");
+ bad!("
+ [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`");
}
}