extend hamcrest matcher pattern (IDEA-169144)

This commit is contained in:
Anna.Kozlova
2017-03-20 17:05:33 +01:00
parent e30711cb87
commit 6a4b4df690
2 changed files with 8 additions and 1 deletions
@@ -24,4 +24,11 @@ public class JUnitExpectedPatternsTest {
public void testArrayComparison() throws Exception {
Assert.assertNotNull(ExpectedPatterns.createExceptionNotification("arrays first differed at element [0]; expected: java.lang.String<Text> but was: java.lang.StringBuilder<Text>"));
}
@Test
public void testHamcrestAssertThatWithReason() throws Exception {
Assert.assertNotNull(ExpectedPatterns.createExceptionNotification("reason\n" +
"Expected: is \"aaa\\naa\"\n" +
" but: was \"bbb\\nbb\""));
}
}
@@ -27,7 +27,7 @@ public class ExpectedPatterns extends AbstractExpectedPatterns {
private static final String[] PATTERN_STRINGS = new String[]{
"\nexpected: is \"(.*)\"\n\\s*got: \"(.*)\"\n",
"\nexpected: is \"(.*)\"\n\\s*but: was \"(.*)\"",
".*?\nexpected: is \"(.*)\"\n\\s*but: was \"(.*)\"",
"\nexpected: (.*)\n\\s*got: (.*)",
".*?\\s*expected same:<(.*)> was not:<(.*)>",
".*?\\s*expected:<(.*?)> but was:<(.*?)>",