Skip to content

Commit

Permalink
report parse errors
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin committed Jan 10, 2024
1 parent 93c9570 commit 281f70b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@ private static void inLine(ParsePosition pp, String line, int lineNumber)
if (failureCount != 0) {
testFailureCount++;
printErrorLine("Test Failure", Side.START, testFailureCount);
// TODO(egg): ::error etc.
String errorMessage =
"Got unexpected "
+ (propertyComparison.shouldBeEqual ? "differences" : "equalities")
Expand Down Expand Up @@ -1075,6 +1074,10 @@ private static int parseError(int parseErrorCount, String line, Exception e, int
println("##" + message);
}
e.printStackTrace(out);
StringWriter w = new StringWriter().append(message).append('\n');
e.printStackTrace(new PrintWriter(w));
reportParseError(lineNumber, w.toString());

out.println("</pre>");
printErrorLine("Parse Error", Side.END, parseErrorCount);
println();
Expand Down Expand Up @@ -1167,6 +1170,10 @@ private static void println() {
println("");
}

private static void reportParseError(int lineNumber, String message) {
reportError(lineNumber, "Parse error", message);
}

private static void reportTestFailure(int lineNumber, String message) {
reportError(lineNumber, "Invariant test failure", message);
}
Expand Down

0 comments on commit 281f70b

Please sign in to comment.