feat: some more tests, a checkpoint
This commit is contained in:
parent
5ca6b8b272
commit
56c52124ec
5 changed files with 170 additions and 2 deletions
39
spec/highlight_spec.lua
Normal file
39
spec/highlight_spec.lua
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
describe('cp.highlight', function()
|
||||
local highlight = require('cp.highlight')
|
||||
|
||||
describe('parse_diff_line', function()
|
||||
it('parses added text markers {+text+}')
|
||||
it('removes removed text markers [-text-]')
|
||||
it('handles mixed add/remove markers')
|
||||
it('calculates correct highlight positions')
|
||||
it('handles text without markers')
|
||||
it('handles empty text')
|
||||
end)
|
||||
|
||||
describe('parse_git_diff', function()
|
||||
it('skips git diff headers')
|
||||
it('processes added lines')
|
||||
it('ignores removed lines')
|
||||
it('handles unchanged lines')
|
||||
it('sets correct line numbers')
|
||||
it('handles empty diff output')
|
||||
end)
|
||||
|
||||
describe('apply_highlights', function()
|
||||
it('clears existing highlights')
|
||||
it('applies extmarks with correct positions')
|
||||
it('uses correct highlight groups')
|
||||
it('handles empty highlights')
|
||||
end)
|
||||
|
||||
describe('create_namespace', function()
|
||||
it('creates unique namespace')
|
||||
end)
|
||||
|
||||
describe('parse_and_apply_diff', function()
|
||||
it('parses diff and applies to buffer')
|
||||
it('sets buffer content')
|
||||
it('applies highlights')
|
||||
it('returns content lines')
|
||||
end)
|
||||
end)
|
||||
Loading…
Add table
Add a link
Reference in a new issue