feat: :CP test -> :CP run

This commit is contained in:
Barrett Ruth 2025-09-19 18:53:39 -04:00
parent ef3d39c7f4
commit dd6bf47684
7 changed files with 64 additions and 90 deletions

View file

@ -51,7 +51,7 @@ describe('cp command parsing', function()
describe('action commands', function()
it('handles test action without error', function()
local opts = { fargs = { 'test' } }
local opts = { fargs = { 'run' } }
assert.has_no_errors(function()
cp.handle_command(opts)
@ -126,7 +126,7 @@ describe('cp command parsing', function()
describe('language flag parsing', function()
it('logs error for --lang flag missing value', function()
local opts = { fargs = { 'test', '--lang' } }
local opts = { fargs = { 'run', '--lang' } }
cp.handle_command(opts)
@ -169,7 +169,7 @@ describe('cp command parsing', function()
describe('debug flag parsing', function()
it('handles debug flag without error', function()
local opts = { fargs = { 'test', '--debug' } }
local opts = { fargs = { 'run', '--debug' } }
assert.has_no_errors(function()
cp.handle_command(opts)
@ -177,7 +177,7 @@ describe('cp command parsing', function()
end)
it('handles combined language and debug flags', function()
local opts = { fargs = { 'test', '--lang=cpp', '--debug' } }
local opts = { fargs = { 'run', '--lang=cpp', '--debug' } }
assert.has_no_errors(function()
cp.handle_command(opts)
@ -234,7 +234,7 @@ describe('cp command parsing', function()
end)
it('handles flag order variations', function()
local opts = { fargs = { '--debug', 'test', '--lang=python' } }
local opts = { fargs = { '--debug', 'run', '--lang=python' } }
assert.has_no_errors(function()
cp.handle_command(opts)
@ -242,7 +242,7 @@ describe('cp command parsing', function()
end)
it('handles multiple language flags', function()
local opts = { fargs = { 'test', '--lang=cpp', '--lang=python' } }
local opts = { fargs = { 'run', '--lang=cpp', '--lang=python' } }
assert.has_no_errors(function()
cp.handle_command(opts)

View file

@ -74,20 +74,10 @@ describe('cp.config', function()
end)
end)
describe('test_panel config validation', function()
describe('run_panel config validation', function()
it('validates diff_mode values', function()
local invalid_config = {
test_panel = { diff_mode = 'invalid' },
}
assert.has_error(function()
config.setup(invalid_config)
end)
end)
it('validates toggle_key is non-empty string', function()
local invalid_config = {
test_panel = { toggle_key = '' },
run_panel = { diff_mode = 'invalid' },
}
assert.has_error(function()
@ -97,7 +87,7 @@ describe('cp.config', function()
it('validates next_test_key is non-empty string', function()
local invalid_config = {
test_panel = { next_test_key = nil },
run_panel = { next_test_key = nil },
}
assert.has_error(function()
@ -107,7 +97,7 @@ describe('cp.config', function()
it('validates prev_test_key is non-empty string', function()
local invalid_config = {
test_panel = { prev_test_key = '' },
run_panel = { prev_test_key = '' },
}
assert.has_error(function()
@ -115,11 +105,10 @@ describe('cp.config', function()
end)
end)
it('accepts valid test_panel config', function()
it('accepts valid run_panel config', function()
local valid_config = {
test_panel = {
run_panel = {
diff_mode = 'git',
toggle_key = 'x',
next_test_key = 'j',
prev_test_key = 'k',
},