@@ -1,3 +1,4 @@
|
||||
import { applyPatch } from "diff";
|
||||
import { chmodSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
||||
import { tmpdir } from "os";
|
||||
import { join } from "path";
|
||||
@@ -239,6 +240,12 @@ describe("Coding Agent Tools", () => {
|
||||
expect(result.details.diff).toBeDefined();
|
||||
expect(typeof result.details.diff).toBe("string");
|
||||
expect(result.details.diff).toContain("testing");
|
||||
expect(result.details.patch).toContain("--- ");
|
||||
expect(result.details.patch).toContain("+++ ");
|
||||
expect(result.details.patch).toContain("@@");
|
||||
expect(result.details.patch).toContain("-Hello, world!");
|
||||
expect(result.details.patch).toContain("+Hello, testing!");
|
||||
expect(applyPatch(originalContent, result.details.patch)).toBe("Hello, testing!");
|
||||
});
|
||||
|
||||
it("should fail if text not found", async () => {
|
||||
|
||||
Reference in New Issue
Block a user