mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
hamcrest matchers extended support (IDEA-102730)
(cherry picked from commit 392d239dcf8bc1a35c0744b37270493743720e70)
This commit is contained in:
@@ -121,6 +121,9 @@ public class JUnit4TestResultsSender extends RunListener {
|
||||
final String message = assertion.getMessage();
|
||||
if (message != null) {
|
||||
PacketFactory notification = createExceptionNotification(assertion, message, "\nExpected: is \"(.*)\"\n\\s*got: \"(.*)\"\n");
|
||||
if (notification == null) {
|
||||
notification = createExceptionNotification(assertion, message, "\nExpected: is \"(.*)\"\n\\s*but: was \"(.*)\"");
|
||||
}
|
||||
if (notification == null) {
|
||||
notification = createExceptionNotification(assertion, message, "\nExpected: (.*)\n\\s*got: (.*)");
|
||||
}
|
||||
@@ -141,7 +144,7 @@ public class JUnit4TestResultsSender extends RunListener {
|
||||
}
|
||||
|
||||
private static PacketFactory createExceptionNotification(Throwable assertion, String message, final String regex) {
|
||||
final Matcher matcher = Pattern.compile(regex, Pattern.DOTALL).matcher(message);
|
||||
final Matcher matcher = Pattern.compile(regex, Pattern.DOTALL | Pattern.CASE_INSENSITIVE).matcher(message);
|
||||
if (matcher.matches()) {
|
||||
return ComparisonDetailsExtractor.create(assertion, matcher.group(1).replaceAll("\\\\n", "\n"), matcher.group(2).replaceAll("\\\\n", "\n"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user