mirror of https://github.com/openclaw/openclaw.git
test: dedupe empty-input mmr assertions
This commit is contained in:
parent
317441d09a
commit
65ef7fb4a4
|
|
@ -108,12 +108,15 @@ describe("computeMMRScore", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("empty input behavior", () => {
|
||||
it("returns empty array for empty input", () => {
|
||||
expect(mmrRerank([])).toEqual([]);
|
||||
expect(applyMMRToHybridResults([])).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("mmrRerank", () => {
|
||||
describe("edge cases", () => {
|
||||
it("returns empty array for empty input", () => {
|
||||
expect(mmrRerank([])).toEqual([]);
|
||||
});
|
||||
|
||||
it("returns single item unchanged", () => {
|
||||
const items: MMRItem[] = [{ id: "1", score: 0.9, content: "hello" }];
|
||||
expect(mmrRerank(items)).toEqual(items);
|
||||
|
|
@ -271,10 +274,6 @@ describe("applyMMRToHybridResults", () => {
|
|||
source: string;
|
||||
};
|
||||
|
||||
it("returns empty array for empty input", () => {
|
||||
expect(applyMMRToHybridResults([])).toEqual([]);
|
||||
});
|
||||
|
||||
it("preserves all original fields", () => {
|
||||
const results: HybridResult[] = [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue