fix(hashline-edit): improve hash computation and tool description clarity
- Include line number in hash computation to ensure uniqueness - Add explicit examples of WRONG vs CORRECT LINE:HASH format - Clarify that hash must be hex characters (0-9, a-f only) - Update tests to use dynamic hash computation
This commit is contained in:
@@ -30,6 +30,18 @@ describe("computeLineHash", () => {
|
||||
expect(hash1).toBe(hash2)
|
||||
})
|
||||
|
||||
it("uses line number in hash input", () => {
|
||||
//#given
|
||||
const content = "const stable = true"
|
||||
|
||||
//#when
|
||||
const hash1 = computeLineHash(1, content)
|
||||
const hash2 = computeLineHash(2, content)
|
||||
|
||||
//#then
|
||||
expect(hash1).not.toBe(hash2)
|
||||
})
|
||||
|
||||
it("handles empty lines", () => {
|
||||
//#given
|
||||
const lineNumber = 1
|
||||
|
||||
Reference in New Issue
Block a user