Skip to content

Commit 8b5503b

Browse files
committed
Fix StatementParserTests
This change fixes StatementParserTests.testPreserveParanthesis as it now depends on capability enabled only on snapshot builds
1 parent d3049e0 commit 8b5503b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/parser/StatementParserTests.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3473,18 +3473,20 @@ public void testFieldNamesAsCommands() throws Exception {
34733473
}
34743474

34753475
// [ and ( are used to trigger a double mode causing their symbol name (instead of text) to be used in error reporting
3476-
// this test checks that their are properly replaced in the error message
3477-
public void testPreserveParanthesis() {
3476+
// this test checks that they are properly replaced in the error message
3477+
public void testPreserveParentheses() {
34783478
// test for (
34793479
expectError("row a = 1 not in", "line 1:17: mismatched input '<EOF>' expecting '('");
34803480
expectError("row a = 1 | where a not in", "line 1:27: mismatched input '<EOF>' expecting '('");
34813481
expectError("row a = 1 | where a not in (1", "line 1:30: mismatched input '<EOF>' expecting {',', ')'}");
34823482
expectError("row a = 1 | where a not in [1", "line 1:28: missing '(' at '['");
34833483
expectError("row a = 1 | where a not in 123", "line 1:28: missing '(' at '123'");
34843484
// test for [
3485-
expectError("explain", "line 1:8: mismatched input '<EOF>' expecting '('");
3486-
expectError("explain ]", "line 1:9: token recognition error at: ']'");
3487-
expectError("explain ( row x = 1", "line 1:20: missing ')' at '<EOF>'");
3485+
if (EsqlCapabilities.Cap.EXPLAIN.isEnabled()) {
3486+
expectError("explain", "line 1:8: mismatched input '<EOF>' expecting '('");
3487+
expectError("explain ]", "line 1:9: token recognition error at: ']'");
3488+
expectError("explain ( row x = 1", "line 1:20: missing ')' at '<EOF>'");
3489+
}
34883490
}
34893491

34903492
public void testRerankDefaultInferenceIdAndScoreAttribute() {

0 commit comments

Comments
 (0)