Skip to content

Commit 43c0d9a

Browse files
committed
Add double tests
1 parent ada9dae commit 43c0d9a

File tree

1 file changed

+22
-0
lines changed
  • x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert

1 file changed

+22
-0
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToDenseVectorTests.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,28 @@ public static Iterable<Object[]> parameters() {
7878
)
7979
);
8080

81+
suppliers.add(
82+
new TestCaseSupplier(
83+
"double",
84+
List.of(DataType.DOUBLE),
85+
() -> {
86+
List<Double> data = Arrays.asList(randomArray(1, 10, Double[]::new, ESTestCase::randomDouble));
87+
return new TestCaseSupplier.TestCase(
88+
List.of(
89+
new TestCaseSupplier.TypedData(
90+
data,
91+
DataType.DOUBLE,
92+
"double"
93+
)
94+
),
95+
evaluatorName("Double", "d"),
96+
DataType.DENSE_VECTOR,
97+
equalTo(data.stream().map(Number::floatValue).toList())
98+
);
99+
}
100+
)
101+
);
102+
81103
return parameterSuppliersFromTypedDataWithDefaultChecksNoErrors(true, suppliers);
82104
}
83105

0 commit comments

Comments
 (0)