Skip to content

Commit a701555

Browse files
committed
feat(test): nicer formatting for check failures
1 parent 6fb197e commit a701555

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main/java/ru/ewc/checklogic/testing/CheckFile.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,13 @@ private static String checkFailureAsHtml(final List<CheckFailure> failures) {
127127
}
128128

129129
private static String formattedDescriptionFor(final CheckFailure failure) {
130-
return "<li>Expected: <kbd>%s</kbd>, but got: <kbd>%s</kbd></li>"
131-
.formatted(failure.expectation(), failure.actual());
130+
return "<li>Expected: <kbd>%s</kbd>, but got: <kbd>%s</kbd></li>".formatted(
131+
CheckFile.clearConstants(failure.expectation()),
132+
CheckFile.clearConstants(failure.actual().split("=")[0])
133+
);
134+
}
135+
136+
private static String clearConstants(final String expectation) {
137+
return expectation.replaceAll("constant::", "");
132138
}
133139
}

0 commit comments

Comments
 (0)