Skip to content

Commit 2bbd16b

Browse files
committed
Add Int Linear, Exp and Gaussian test cases
1 parent 9b8fe64 commit 2bbd16b

File tree

1 file changed

+20
-2
lines changed
  • x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext

1 file changed

+20
-2
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/DecayTests.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,26 @@ public DecayTests(@Name("TestCase") Supplier<TestCaseSupplier.TestCase> testCase
3838
public static Iterable<Object[]> parameters() {
3939
List<TestCaseSupplier> testCaseSuppliers = new ArrayList<>();
4040

41-
// Int
42-
testCaseSuppliers.addAll(intTestCase(5, 10, 10, 0, 0.5, "linear", 0.75));
41+
// Int Linear
42+
testCaseSuppliers.addAll(intTestCase(0, 0, 10, 5, 0.5, "linear", 1.0));
43+
testCaseSuppliers.addAll(intTestCase(10, 0, 10, 5, 0.5, "linear", 0.75));
44+
testCaseSuppliers.addAll(intTestCase(50, 5, 100, 10, 0.25, "linear", 0.7375));
45+
testCaseSuppliers.addAll(intTestCase(100, 17, 156, 23, 0.123, "linear", 0.6626923076923077));
46+
testCaseSuppliers.addAll(intTestCase(2500, 0, 10, 0, 0.5, "linear", 0.0));
47+
48+
// Int Exponential
49+
testCaseSuppliers.addAll(intTestCase(0, 0, 10, 5, 0.5, "exp", 1.0));
50+
testCaseSuppliers.addAll(intTestCase(10, 0, 10, 5, 0.5, "exp", 0.7071067811865475));
51+
testCaseSuppliers.addAll(intTestCase(50, 5, 100, 10, 0.25, "exp", 0.6155722066724582));
52+
testCaseSuppliers.addAll(intTestCase(100, 17, 156, 23, 0.123, "exp", 0.4466460570185927));
53+
testCaseSuppliers.addAll(intTestCase(2500, 0, 10, 0, 0.5, "exp", 5.527147875260539E-76));
54+
55+
// Int Gaussian
56+
testCaseSuppliers.addAll(intTestCase(0, 0, 10, 5, 0.5, "gauss", 1.0));
57+
testCaseSuppliers.addAll(intTestCase(10, 0, 10, 5, 0.5, "gauss", 0.8408964152537146));
58+
testCaseSuppliers.addAll(intTestCase(50, 5, 100, 10, 0.25, "gauss", 0.8438157961300179));
59+
testCaseSuppliers.addAll(intTestCase(100, 17, 156, 23, 0.123, "gauss", 0.7334501109633149));
60+
testCaseSuppliers.addAll(intTestCase(2500, 0, 10, 0, 0.5, "gauss", 0.0));
4361

4462
// Long
4563
testCaseSuppliers.addAll(longTestCase(5L, 10L, 10L, 0L, 0.5, "linear", 0.75));

0 commit comments

Comments
 (0)