Skip to content

Commit af35b37

Browse files
committed
Fix date nanos unit tests
1 parent 3f0f944 commit af35b37

File tree

1 file changed

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

1 file changed

+8
-8
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ public static Iterable<Object[]> parameters() {
103103

104104
testCaseSuppliers.addAll(
105105
dateNanosScaleTextTestCase(
106-
dateOne.toEpochMilli() + dateOne.getNano(),
107-
dateTwo.toEpochMilli() + dateTwo.getNano(),
106+
dateOne.getEpochSecond() * 1_000_000_000L + dateOne.getNano(),
107+
dateTwo.getEpochSecond() * 1_000_000_000L + dateTwo.getNano(),
108108
"24 hours",
109109
"0 seconds",
110110
0.5,
@@ -114,8 +114,8 @@ public static Iterable<Object[]> parameters() {
114114
);
115115
testCaseSuppliers.addAll(
116116
dateNanosScaleKeywordTestCase(
117-
dateOne.toEpochMilli() + dateOne.getNano(),
118-
dateTwo.toEpochMilli() + dateTwo.getNano(),
117+
dateOne.getEpochSecond() * 1_000_000_000L + dateOne.getNano(),
118+
dateTwo.getEpochSecond() * 1_000_000_000L + dateTwo.getNano(),
119119
"24 hours",
120120
"0 seconds",
121121
0.5,
@@ -125,8 +125,8 @@ public static Iterable<Object[]> parameters() {
125125
);
126126
testCaseSuppliers.addAll(
127127
dateNanosTestCase(
128-
dateOne.toEpochMilli() + dateOne.getNano(),
129-
dateTwo.toEpochMilli() + dateTwo.getNano(),
128+
dateOne.getEpochSecond() * 1_000_000_000L + dateOne.getNano(),
129+
dateTwo.getEpochSecond() * 1_000_000_000L + dateTwo.getNano(),
130130
Period.ofDays(1),
131131
"0 seconds",
132132
0.5,
@@ -136,8 +136,8 @@ public static Iterable<Object[]> parameters() {
136136
);
137137
testCaseSuppliers.addAll(
138138
dateNanosTestCase(
139-
dateOne.toEpochMilli() + dateOne.getNano(),
140-
dateTwo.toEpochMilli() + dateTwo.getNano(),
139+
dateOne.getEpochSecond() * 1_000_000_000L + dateOne.getNano(),
140+
dateTwo.getEpochSecond() * 1_000_000_000L + dateTwo.getNano(),
141141
Duration.ofDays(1),
142142
"0 seconds",
143143
0.5,

0 commit comments

Comments
 (0)