fix(ida): compare admitted document paths consistently

This commit is contained in:
morluto
2026-10-10 05:13:53 +08:00
parent 53ed942a85
commit 890bb66b35
2 changed files with 23 additions and 2 deletions
+19
View File
@@ -1,4 +1,5 @@
import { readFile, readdir, rm } from "node:fs/promises";
import { sep } from "node:path";
import { afterEach, describe, expect, it } from "vitest";
import { z } from "zod";
import {
@@ -111,6 +112,24 @@ describe("headless IDA producer pagination", () => {
});
describe("attached IDA observation semantics", () => {
it("accepts a normalized spelling of the bound document path", async () => {
const { target, producer, client } = await fixture();
const equivalent =
process.platform === "win32"
? target.path.toLowerCase().replaceAll("\\", "/")
: target.path.split(sep).join(`${sep}.${sep}`);
const result = await client.execute("list_procedures", {
document: equivalent,
});
expect(result.ok).toBe(true);
expect(producer.calls.some(({ name }) => name === "list_functions")).toBe(
true,
);
await client.close();
});
it("rejects an unrelated document before connecting or opening a provider", async () => {
const { producer, client } = await fixture();
const result = await client.execute("list_procedures", {