Test: Fix error message check for Windows

Betrayal! CRLF strikes again. Weakened the test from equals to
containsString.
This commit is contained in:
Nik Everett 2016-06-14 09:56:49 -04:00
parent 4d78f280ed
commit 49c09f1527
1 changed files with 3 additions and 1 deletions

View File

@ -25,6 +25,7 @@ import java.util.Collections;
import java.util.regex.PatternSyntaxException; import java.util.regex.PatternSyntaxException;
import static java.util.Collections.emptyMap; import static java.util.Collections.emptyMap;
import static org.hamcrest.Matchers.containsString;
public class WhenThingsGoWrongTests extends ScriptTestCase { public class WhenThingsGoWrongTests extends ScriptTestCase {
public void testNullPointer() { public void testNullPointer() {
@ -224,7 +225,8 @@ public class WhenThingsGoWrongTests extends ScriptTestCase {
PatternSyntaxException e = expectScriptThrows(PatternSyntaxException.class, () -> { PatternSyntaxException e = expectScriptThrows(PatternSyntaxException.class, () -> {
exec("/\\ujjjj/"); // Invalid unicode exec("/\\ujjjj/"); // Invalid unicode
}); });
assertEquals("Illegal Unicode escape sequence near index 2\n\\ujjjj\n ^", e.getMessage()); assertThat(e.getMessage(), containsString("Illegal Unicode escape sequence near index 2"));
assertThat(e.getMessage(), containsString("\\ujjjj"));
} }
} }