Skip to content

Commit a41492e

Browse files
cliffhallclaude
andcommitted
test(memory): check the graph around each repeated write call
A single comparison after all three repeats could miss a repeat that changed the graph if a later repeat undid it. Compare before and after each repeat, and assert the initial calls succeeded. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: cliffhall <[email protected]>
1 parent d7ebd6f commit a41492e

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎src/memory/__tests__/tools.test.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,14 +406,16 @@ describe("memory tools over the protocol", () => {
406406
],
407407
];
408408
for (const [name, args] of calls) {
409-
await call(client, name, args);
409+
expect((await call(client, name, args)).isError).toBeUndefined();
410410
}
411-
const once = await readGraph();
411+
// Compare around each repeat on its own, so a later repeat cannot mask
412+
// a change an earlier one made.
412413
for (const [name, args] of calls) {
414+
const before = await readGraph();
413415
const repeat = await call(client, name, args);
414416
expect(repeat.isError).toBeUndefined();
417+
expect(await readGraph()).toEqual(before);
415418
}
416-
expect(await readGraph()).toEqual(once);
417419
});
418420

419421
it("offers no prompts", async () => {

0 commit comments

Comments
 (0)