Skip to content

Commit

Permalink
feat(objectionary#3756): fix test cases according with the new format…
Browse files Browse the repository at this point in the history
…ting
  • Loading branch information
volodya-lombrozo committed Dec 25, 2024
1 parent 4e5f1f5 commit 76bf5a0
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
*/
package org.eolang.parser;

/**
* Error message that includes the location of the error.
* @since 0.50
*/
final class LocationMessage {

/**
Expand Down Expand Up @@ -57,6 +61,6 @@ final class LocationMessage {
* @return The formatted error message.
*/
String formatted() {
return String.format("[%d:%d] error: \"%s\"", this.line, this.position, this.message);
return String.format("[%d:%d] error: '%s'", this.line, this.position, this.message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
---
line: 2
message: >-
[2:4] error: Invalid object declaration:
[2:4] error: 'Invalid object declaration'
y:^
^
input: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
---
line: 2
message: |-
[2:7] error: Invalid object declaration:
[2:7] error: 'Invalid object declaration'
[] > a [] > b [] > c [] > d hello world
^
input: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ line: 5
# comment. The error message should be updated to point to the exact position
# of the comment.
message: |
[5:12] error: Invalid object declaration:
[5:12] error: 'Invalid object declaration'
sprintwf
input: |
# No comments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ line: 4
# Cryptic error message is returned when there are two empty lines between metas.
# The error message should be more informative and should highlight the exact location
# of the error.
message: |-
[4:0] error: extraneous input '\n' expecting {COMMENTARY, 'Q', 'QQ', '*', '$', '[', '(', '@', '^', BYTES, STRING, INT, FLOAT, HEX, NAME, TEXT}
message: |
[4:0] error: 'extraneous input '\n' expecting {COMMENTARY, 'Q', 'QQ', '*', '$', '[', '(', '@', '^', BYTES, STRING, INT, FLOAT, HEX, NAME, TEXT}'
input: |
# No comments.
[args] > one
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
---
line: 1
message: |-
[1:10] error: Invalid meta declaration:
[1:10] error: 'Invalid meta declaration'
+meta with spaces
^
input: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
---
line: 3
message: |-
[3:0] error: Invalid object declaration:
[3:0] error: 'Invalid object declaration'
+meta other
^^^^^^^^^^
input: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
---
line: 3
message: |-
[3:0] error: Invalid meta declaration:
[3:0] error: 'Invalid meta declaration'
[] > main
^
input: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
---
line: 4
message: |-
[4:-1] error: Invalid program declaration:
[4:-1] error: 'Invalid program declaration'
[] > inner
^^^^^^^^^^^^
input: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
---
line: 3
message: |-
[3:-1] error: Invalid program declaration:
[3:-1] error: 'Invalid program declaration'
EOF
^^^
input: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ line: 3
# place in the input where the error occurred. Moreover it should be clear
# what to do to fix the error. 'simple-application-named.yaml' has the same issue.
message: |-
[3:-1] error: Invalid program declaration:
[3:-1] error: 'Invalid program declaration'
EOF
^^^
input: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
---
line: 5
message: >-
[5:2] error: Invalid object declaration:
[5:2] error: 'Invalid object declaration'
*
^
input: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
---
line: 2
message: |-
[2:0] error: Invalid program declaration:
[2:0] error: 'Invalid program declaration'
.z
^
input: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
---
line: 2
message: |-
[2:0] error: Invalid program declaration:
[2:0] error: 'Invalid program declaration'
.z
^
input: |
Expand Down

0 comments on commit 76bf5a0

Please sign in to comment.