Skip to content

Commit

Permalink
feat(objectionary#3332): check parsing messages
Browse files Browse the repository at this point in the history
  • Loading branch information
volodya-lombrozo committed Dec 18, 2024
1 parent ad60f38 commit 6819abb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,14 @@ void checksTypoPacks(final String yaml) {
Integer.parseInt(story.after().xpath("/program/errors/error[1]/@line").get(0)),
Matchers.equalTo(Integer.parseInt(story.map().get("line").toString()))
);
final String msg = "message";
if (story.map().containsKey(msg)) {
MatcherAssert.assertThat(
XhtmlMatchers.xhtml(story.after()).toString(),
story.after().xpath("/program/errors/error[1]/text()").get(0),
Matchers.equalTo(story.map().get(msg).toString())
);
}
}

@ParameterizedTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
# SOFTWARE.
---
line: 2
message: >-
[2:4] no viable alternative at input 'x\n INTy:^': " y:^"
input: |
x
y:^

0 comments on commit 6819abb

Please sign in to comment.