test(server): assert the separator-independent source path
`SourceLocation.file` is normalized to forward slashes now — it goes into the edit prompt, into the JSON an MCP tool returns where each backslash arrives doubled, and into the overlay as a display label. The assertion still built its expectation with `join`, so it demanded a native path and failed on Windows against the value the resolver is now meant to produce.
This commit is contained in:
@@ -163,7 +163,11 @@ describe("preparePromptInput — source backfill", () => {
|
||||
source: { file: "/src/App.tsx", line: 4 },
|
||||
})
|
||||
);
|
||||
expect(input.source?.file).toBe(join("src", "App.tsx"));
|
||||
// Forward slashes, not `join`: this value is separator-independent by
|
||||
// design. It goes into the edit prompt, into the JSON an MCP tool returns
|
||||
// (where a backslash arrives doubled), and into the overlay as a label, so
|
||||
// the resolver normalizes it rather than emitting a native path.
|
||||
expect(input.source?.file).toBe("src/App.tsx");
|
||||
expect(input.source?.context).toContain("Get Started");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user