mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 13:19:02 +00:00
Repair broken year query test.
This commit is contained in:
parent
a278fc6296
commit
535a51a621
@ -27,12 +27,12 @@ import org.junit.jupiter.api.parallel.Execution;
|
|||||||
import spark.Spark;
|
import spark.Spark;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Collections;
|
import java.util.stream.Collectors;
|
||||||
import java.util.EnumSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
import static org.junit.jupiter.api.parallel.ExecutionMode.SAME_THREAD;
|
import static org.junit.jupiter.api.parallel.ExecutionMode.SAME_THREAD;
|
||||||
|
|
||||||
@Execution(SAME_THREAD)
|
@Execution(SAME_THREAD)
|
||||||
@ -153,9 +153,18 @@ public class IndexQueryServiceIntegrationTest {
|
|||||||
))
|
))
|
||||||
).build());
|
).build());
|
||||||
|
|
||||||
Assertions.assertArrayEquals(
|
|
||||||
new int[] { 12, 72, 132, 192, 252, 312, 372, 432, 492, 32 },
|
Set<Integer> years = new HashSet<>();
|
||||||
rsp.results.stream().mapToInt(SearchResultItem::getUrlIdInt).toArray());
|
|
||||||
|
for (var res : rsp.results) {
|
||||||
|
for (var score : res.getKeywordScores()) {
|
||||||
|
years.add(DocumentMetadata.decodeYear(score.encodedDocMetadata()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
assertEquals(Set.of(1998), years);
|
||||||
|
assertEquals(rsp.results.size(), 10);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user