feat: some more tests, a checkpoint
This commit is contained in:
parent
5ca6b8b272
commit
56c52124ec
5 changed files with 170 additions and 2 deletions
42
spec/diff_spec.lua
Normal file
42
spec/diff_spec.lua
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
describe('cp.diff', function()
|
||||
local diff = require('cp.diff')
|
||||
|
||||
describe('get_available_backends', function()
|
||||
it('returns vim and git backends')
|
||||
end)
|
||||
|
||||
describe('get_backend', function()
|
||||
it('returns vim backend by name')
|
||||
it('returns git backend by name')
|
||||
it('returns nil for invalid name')
|
||||
end)
|
||||
|
||||
describe('is_git_available', function()
|
||||
it('returns true when git command succeeds')
|
||||
it('returns false when git command fails')
|
||||
end)
|
||||
|
||||
describe('get_best_backend', function()
|
||||
it('returns preferred backend when available')
|
||||
it('falls back to vim when git unavailable')
|
||||
it('defaults to vim backend')
|
||||
end)
|
||||
|
||||
describe('vim backend', function()
|
||||
it('returns content as-is')
|
||||
it('returns nil highlights')
|
||||
end)
|
||||
|
||||
describe('git backend', function()
|
||||
it('creates temp files for diff')
|
||||
it('returns raw diff output')
|
||||
it('cleans up temp files')
|
||||
it('handles no differences')
|
||||
it('handles git command failure')
|
||||
end)
|
||||
|
||||
describe('render_diff', function()
|
||||
it('uses best available backend')
|
||||
it('passes parameters to backend')
|
||||
end)
|
||||
end)
|
||||
Loading…
Add table
Add a link
Reference in a new issue