diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/TestCaseSupplier.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/TestCaseSupplier.java index 520bd9bc630a4..64fca761e48cc 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/TestCaseSupplier.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/TestCaseSupplier.java @@ -263,18 +263,9 @@ public static List forBinaryNumericNotCasting( ); } - public record StuffForNumericType( - Number min, - Number max, - BinaryOperator expected, - String evaluatorName - ) {} + public record StuffForNumericType(Number min, Number max, BinaryOperator expected, String evaluatorName) {} - public record AllTheTypeSpecificSettings( - StuffForNumericType intStuff, - StuffForNumericType longStuff, - StuffForNumericType doubleStuff - ) { + public record AllTheTypeSpecificSettings(StuffForNumericType intStuff, StuffForNumericType longStuff, StuffForNumericType doubleStuff) { public StuffForNumericType get(DataType type) { if (type == DataTypes.INTEGER) { return intStuff; @@ -334,7 +325,7 @@ public static List forBinaryWithWidening( for (DataType rhsType : numericTypes) { DataType expected = widen(lhsType, rhsType); StuffForNumericType expectedTypeStuff = typeStuff.get(expected); - String evaluator = expectedTypeStuff.evaluatorName() + String evaluator = expectedTypeStuff.evaluatorName() + "[" + lhsName + "=" @@ -344,16 +335,16 @@ public static List forBinaryWithWidening( + "=" + getCastEvaluator("Attribute[channel=1]", rhsType, expected) + "]"; - casesCrossProduct( - (l, r) -> expectedTypeStuff.expected().apply((Number) l, (Number) r), - getSuppliersForNumericType(lhsType, expectedTypeStuff.min(), expectedTypeStuff.max()), - getSuppliersForNumericType(rhsType, expectedTypeStuff.min(), expectedTypeStuff.max()), - // TODO: This doesn't really need to be a function - (lt, rt) -> evaluator, - warnings, - suppliers, - expected - ); + casesCrossProduct( + (l, r) -> expectedTypeStuff.expected().apply((Number) l, (Number) r), + getSuppliersForNumericType(lhsType, expectedTypeStuff.min(), expectedTypeStuff.max()), + getSuppliersForNumericType(rhsType, expectedTypeStuff.min(), expectedTypeStuff.max()), + // TODO: This doesn't really need to be a function + (lt, rt) -> evaluator, + warnings, + suppliers, + expected + ); } } diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddTests.java index 22d7e5cd3990d..edf199942f688 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddTests.java @@ -73,7 +73,7 @@ public static Iterable parameters() { // Unsigned Long cases // TODO: These should be integrated into the type cross product above, but are currently broken - // see https://github.com/elastic/elasticsearch/issues/102935 + // see https://github.com/elastic/elasticsearch/issues/102935 suppliers.addAll( TestCaseSupplier.forBinaryNotCasting( "AddUnsignedLongsEvaluator",