Skip to content

Commit ddd06dc

Browse files
fix tests
1 parent 79a13e1 commit ddd06dc

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2511,6 +2511,10 @@ public void testInvalidNamedParamsForIdentifiers() {
25112511
}
25122512

25132513
public void testNamedDoubleParamsForIdentifiers() {
2514+
assumeTrue(
2515+
"double parameters markers for identifiers requires snapshot build",
2516+
EsqlCapabilities.Cap.DOUBLE_PARAMETER_MARKERS_FOR_IDENTIFIERS.isEnabled()
2517+
);
25142518
assertProjectionWithMapping(
25152519
"""
25162520
from test

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

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,15 +1256,23 @@ public void testInvalidNamedParams() {
12561256

12571257
expectError("from test | where x < ?#1", List.of(paramAsConstant("#1", 5)), "token recognition error at: '#'");
12581258

1259-
expectError(
1260-
"from test | where x < ???",
1261-
List.of(paramAsConstant("n_1", 5), paramAsConstant("n_2", 5)),
1262-
"extraneous input '?' expecting <EOF>"
1263-
);
1264-
12651259
expectError("from test | where x < ?Å", List.of(paramAsConstant("Å", 5)), "line 1:24: token recognition error at: 'Å'");
12661260

12671261
expectError("from test | eval x = ?Å", List.of(paramAsConstant("Å", 5)), "line 1:23: token recognition error at: 'Å'");
1262+
1263+
if (EsqlCapabilities.Cap.DOUBLE_PARAMETER_MARKERS_FOR_IDENTIFIERS.isEnabled()) {
1264+
expectError(
1265+
"from test | where x < ???",
1266+
List.of(paramAsConstant("n_1", 5), paramAsConstant("n_2", 5)),
1267+
"extraneous input '?' expecting <EOF>"
1268+
);
1269+
} else {
1270+
expectError(
1271+
"from test | where x < ??",
1272+
List.of(paramAsConstant("n_1", 5), paramAsConstant("n_2", 5)),
1273+
"extraneous input '?' expecting <EOF>"
1274+
);
1275+
}
12681276
}
12691277

12701278
public void testPositionalParams() {

0 commit comments

Comments
 (0)