import { describe, it, expect } from "vitest";
import { generateDiff } from "../../utils/diff.js";
describe("generateDiff", () => {
    it("should generate diff with removed and added lines", () => {
        const result = generateDiff("const x = 1;", "const x = 2;");
        expect(result).toBe("-const x = 1;\n+const x = 2;");
    });
    it("should handle single line changes", () => {
        const result = generateDiff("hello", "world");
        expect(result).toContain("-hello");
        expect(result).toContain("+world");
    });
    it("should handle multi-line changes", () => {
        const oldStr = "line1\nline2\nline3";
        const newStr = "line1\nmodified\nline3\nline4";
        const result = generateDiff(oldStr, newStr);
        expect(result).toContain("-line1");
        expect(result).toContain("-line2");
        expect(result).toContain("-line3");
        expect(result).toContain("+line1");
        expect(result).toContain("+modified");
        expect(result).toContain("+line3");
        expect(result).toContain("+line4");
    });
    it("should return empty string for identical strings", () => {
        const result = generateDiff("same content", "same content");
        expect(result).toBe("");
    });
    it("should handle empty old_string (new content)", () => {
        const result = generateDiff("", "new content");
        expect(result).toContain("-");
        expect(result).toContain("+new content");
    });
    it("should handle empty new_string (deleted content)", () => {
        const result = generateDiff("old content", "");
        expect(result).toContain("-old content");
        expect(result).toContain("+");
    });
});
//# sourceMappingURL=diff.test.js.map