Skip to content

Commit

Permalink
ESQL: Fix error test on windows (elastic#104340)
Browse files Browse the repository at this point in the history
This fixes a test on windows - the error message contains the platform
local line endings because it comes from the jvm.

Closes elastic#104296 Closes elastic#104245
  • Loading branch information
nik9000 authored Jan 12, 2024
1 parent a84ce72 commit 97d0c8c
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static Iterable<Object[]> parameters() {
)
);

suppliers.add(new TestCaseSupplier(List.of(DataTypes.KEYWORD, DataTypes.KEYWORD, DataTypes.KEYWORD), () -> {
suppliers.add(new TestCaseSupplier("syntax error", List.of(DataTypes.KEYWORD, DataTypes.KEYWORD, DataTypes.KEYWORD), () -> {
String text = randomAlphaOfLength(10);
String invalidRegex = "[";
String newStr = randomAlphaOfLength(5);
Expand All @@ -94,8 +94,16 @@ public static Iterable<Object[]> parameters() {
DataTypes.KEYWORD,
equalTo(null)
).withWarning("Line -1:-1: evaluation of [] failed, treating result as null. Only first 20 failures recorded.")
.withWarning("Line -1:-1: java.util.regex.PatternSyntaxException: Unclosed character class near index 0\n[\n^")
.withFoldingException(PatternSyntaxException.class, "Unclosed character class near index 0\n[\n^");
.withWarning(
"Line -1:-1: java.util.regex.PatternSyntaxException: Unclosed character class near index 0\n[\n^".replaceAll(
"\n",
System.lineSeparator()
)
)
.withFoldingException(
PatternSyntaxException.class,
"Unclosed character class near index 0\n[\n^".replaceAll("\n", System.lineSeparator())
);
}));
return parameterSuppliersFromTypedData(errorsForCasesWithoutExamples(anyNullIsNull(false, suppliers)));
}
Expand Down

0 comments on commit 97d0c8c

Please sign in to comment.