aboutsummaryrefslogtreecommitdiff
path: root/test-suite/tests/parser.rs
diff options
context:
space:
mode:
authorAndres Suarez <zertosh@gmail.com>2019-07-30 17:20:18 +0000
committerAndres Suarez <zertosh@gmail.com>2019-07-30 13:35:08 -0400
commit144e1d0f90f3e83e7e3cf0764869c2bbef687397 (patch)
tree53ebe73de9653c1e5084ad99a7613f76e900ad32 /test-suite/tests/parser.rs
parent59aa7214f0c76f95f192f5b4641342ebd740f567 (diff)
downloadmilf-rs-144e1d0f90f3e83e7e3cf0764869c2bbef687397.tar.gz
milf-rs-144e1d0f90f3e83e7e3cf0764869c2bbef687397.zip
Add line and column to all Errors
Diffstat (limited to 'test-suite/tests/parser.rs')
-rw-r--r--test-suite/tests/parser.rs37
1 files changed, 23 insertions, 14 deletions
diff --git a/test-suite/tests/parser.rs b/test-suite/tests/parser.rs
index 1a684c5..012bd65 100644
--- a/test-suite/tests/parser.rs
+++ b/test-suite/tests/parser.rs
@@ -453,7 +453,10 @@ fn inline_tables() {
"a = {,}",
"expected a table key, found a comma at line 1 column 6"
);
- bad!("a = {a=1,a=1}", "duplicate key: `a` for key `a`");
+ bad!(
+ "a = {a=1,a=1}",
+ "duplicate key: `a` for key `a` at line 1 column 5"
+ );
bad!(
"a = {\n}",
"expected a table key, found a newline at line 1 column 6"
@@ -533,9 +536,15 @@ fn booleans() {
let table = "foo = false".parse::<Value>().unwrap();
assert_eq!(table["foo"].as_bool(), Some(false));
- bad!("foo = true2", "failed to parse datetime for key `foo`");
+ bad!(
+ "foo = true2",
+ "failed to parse datetime for key `foo` at line 1 column 7"
+ );
bad!("foo = false2", "invalid number at line 1 column 7");
- bad!("foo = t1", "failed to parse datetime for key `foo`");
+ bad!(
+ "foo = t1",
+ "failed to parse datetime for key `foo` at line 1 column 7"
+ );
bad!("foo = f2", "invalid number at line 1 column 7");
}
@@ -547,28 +556,28 @@ fn bad_nesting() {
[[a]]
b = 5
",
- "duplicate key: `a`"
+ "duplicate key: `a` at line 3 column 9"
);
bad!(
"
a = 1
[a.b]
",
- "duplicate key: `a`"
+ "duplicate key: `a` at line 3 column 9"
);
bad!(
"
a = []
[a.b]
",
- "duplicate key: `a`"
+ "duplicate key: `a` at line 3 column 9"
);
bad!(
"
a = []
[[a.b]]
",
- "duplicate key: `a`"
+ "duplicate key: `a` at line 3 column 9"
);
bad!(
"
@@ -577,7 +586,7 @@ fn bad_nesting() {
[a.b]
c = 2
",
- "duplicate key: `b` for key `a`"
+ "duplicate key: `b` for key `a` at line 4 column 9"
);
}
@@ -608,7 +617,7 @@ fn bad_table_redefine() {
b = {}
[a.b]
",
- "duplicate key: `b` for key `a`"
+ "duplicate key: `b` for key `a` at line 4 column 9"
);
bad!(
@@ -637,23 +646,23 @@ fn datetimes() {
t!("2016-09-09T09:09:09.123456789-02:00");
bad!(
"foo = 2016-09-09T09:09:09.Z",
- "failed to parse datetime for key `foo`"
+ "failed to parse datetime for key `foo` at line 1 column 7"
);
bad!(
"foo = 2016-9-09T09:09:09Z",
- "failed to parse datetime for key `foo`"
+ "failed to parse datetime for key `foo` at line 1 column 7"
);
bad!(
"foo = 2016-09-09T09:09:09+2:00",
- "failed to parse datetime for key `foo`"
+ "failed to parse datetime for key `foo` at line 1 column 7"
);
bad!(
"foo = 2016-09-09T09:09:09-2:00",
- "failed to parse datetime for key `foo`"
+ "failed to parse datetime for key `foo` at line 1 column 7"
);
bad!(
"foo = 2016-09-09T09:09:09Z-2:00",
- "failed to parse datetime for key `foo`"
+ "failed to parse datetime for key `foo` at line 1 column 7"
);
}