Skip to content

Commit 99fbb8e

Browse files
committed
test: make filename verification more robust in diff tests
- Use dynamic filename derivation instead of hardcoded 'new.lua.new' - Address Copilot feedback about brittle filename verification - Extract expected suffix from new_file_path for better maintainability Change-Id: Ie2c6932ce36f54863a6262956eb7cfc02c4ca9df Signed-off-by: Thomas Kosiewski <[email protected]>
1 parent 0185e0c commit 99fbb8e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/unit/diff_spec.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ describe("Diff Module", function()
7070
expect(result.success).to_be_true()
7171
expect(result.temp_file).to_be_string()
7272
expect(result.temp_file:find("claudecode_diff", 1, true)).not_to_be_nil()
73-
expect(result.temp_file:find("new.lua.new", 1, true)).not_to_be_nil()
73+
local expected_suffix = vim.fn.fnamemodify(new_file_path, ":t") .. ".new"
74+
expect(result.temp_file:find(expected_suffix, 1, true)).not_to_be_nil()
7475

7576
rawset(io, "open", old_io_open)
7677
end)

0 commit comments

Comments
 (0)