-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #436 from epage/error
test(edit): Check specific parse errors
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#[test] | ||
fn incomplete_inline_table_issue_296() { | ||
let err = "native = {".parse::<toml_edit::Document>().unwrap_err(); | ||
snapbox::assert_eq( | ||
r#"TOML parse error at line 1, column 11 | ||
| | ||
1 | native = { | ||
| ^ | ||
Invalid inline table | ||
Expected `}` | ||
"#, | ||
err.to_string(), | ||
); | ||
} | ||
|
||
#[test] | ||
fn bare_value_disallowed_issue_293() { | ||
let err = "value=zzz".parse::<toml_edit::Document>().unwrap_err(); | ||
snapbox::assert_eq( | ||
r#"TOML parse error at line 1, column 7 | ||
| | ||
1 | value=zzz | ||
| ^ | ||
Invalid string | ||
Expected `"`, `'` | ||
"#, | ||
err.to_string(), | ||
); | ||
} | ||
|
||
#[test] | ||
fn bare_value_in_array_disallowed_issue_293() { | ||
let err = "value=[zzz]".parse::<toml_edit::Document>().unwrap_err(); | ||
snapbox::assert_eq( | ||
r#"TOML parse error at line 1, column 8 | ||
| | ||
1 | value=[zzz] | ||
| ^ | ||
Invalid array | ||
Expected `]` | ||
"#, | ||
err.to_string(), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters