mirror of https://github.com/openclaw/openclaw.git
test: tighten shared process map and model coverage
This commit is contained in:
parent
2f82ade66f
commit
fe55622205
|
|
@ -5,10 +5,13 @@ describe("shared/model-param-b", () => {
|
||||||
it("extracts the largest valid b-sized parameter token", () => {
|
it("extracts the largest valid b-sized parameter token", () => {
|
||||||
expect(inferParamBFromIdOrName("llama-8b mixtral-22b")).toBe(22);
|
expect(inferParamBFromIdOrName("llama-8b mixtral-22b")).toBe(22);
|
||||||
expect(inferParamBFromIdOrName("Qwen 0.5B Instruct")).toBe(0.5);
|
expect(inferParamBFromIdOrName("Qwen 0.5B Instruct")).toBe(0.5);
|
||||||
|
expect(inferParamBFromIdOrName("prefix M7B and q4_32b")).toBe(32);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("ignores malformed, zero, and non-delimited matches", () => {
|
it("ignores malformed, zero, and non-delimited matches", () => {
|
||||||
expect(inferParamBFromIdOrName("abc70beta 0b x70b2")).toBeNull();
|
expect(inferParamBFromIdOrName("abc70beta 0b x70b2")).toBeNull();
|
||||||
expect(inferParamBFromIdOrName("model 0b")).toBeNull();
|
expect(inferParamBFromIdOrName("model 0b")).toBeNull();
|
||||||
|
expect(inferParamBFromIdOrName("model b5")).toBeNull();
|
||||||
|
expect(inferParamBFromIdOrName("foo70bbar")).toBeNull();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -26,4 +26,14 @@ describe("shared/process-scoped-map", () => {
|
||||||
|
|
||||||
expect(second).not.toBe(first);
|
expect(second).not.toBe(first);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("reuses a prepopulated process map without replacing it", () => {
|
||||||
|
const existing = new Map<string, number>([["a", 1]]);
|
||||||
|
(process as unknown as Record<symbol, unknown>)[MAP_KEY] = existing;
|
||||||
|
|
||||||
|
const resolved = resolveProcessScopedMap<number>(MAP_KEY);
|
||||||
|
|
||||||
|
expect(resolved).toBe(existing);
|
||||||
|
expect(resolved.get("a")).toBe(1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue