Skip to content

Commit

Permalink
[8.x] ES|QL: make ignoreOrder parsing more strict in CSV tests (elast…
Browse files Browse the repository at this point in the history
  • Loading branch information
luigidellaquila authored Dec 6, 2024
1 parent ffc31fd commit be11a06
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ public Object parse(String line) {
testCase.expectedWarningsRegexString.add(regex);
testCase.expectedWarningsRegex.add(warningRegexToPattern(regex));
} else if (lower.startsWith("ignoreorder:")) {
testCase.ignoreOrder = Boolean.parseBoolean(line.substring("ignoreOrder:".length()).trim());
String value = lower.substring("ignoreOrder:".length()).trim();
if ("true".equals(value)) {
testCase.ignoreOrder = true;
} else if ("false".equals(value) == false) {
throw new IllegalArgumentException("Invalid value for ignoreOrder: [" + value + "], it can only be true or false");
}
} else if (line.startsWith(";")) {
testCase.expectedResults = data.toString();
// clean-up and emit
Expand Down

0 comments on commit be11a06

Please sign in to comment.