This commit is contained in:
Barrett Ruth 2025-09-19 00:29:36 -04:00
parent fe29129777
commit 973d03baa4
2 changed files with 32 additions and 15 deletions

View file

@ -29,7 +29,7 @@ describe('cp integration', function()
if cmd[1] == 'ping' then if cmd[1] == 'ping' then
result = { code = 0, stdout = '', stderr = '' } result = { code = 0, stdout = '', stderr = '' }
elseif cmd[1] == 'uv' and cmd[2] == 'sync' then elseif cmd[1] == 'uv' and cmd[2] == 'sync' then
result = { code = 0, stdout = '', stderr = '' } result = { code = 0, stdout = 'Dependencies synced', stderr = '' }
elseif cmd[1] == 'uv' and cmd[2] == 'run' then elseif cmd[1] == 'uv' and cmd[2] == 'run' then
if vim.tbl_contains(cmd, 'metadata') then if vim.tbl_contains(cmd, 'metadata') then
result.stdout = result.stdout =
@ -88,7 +88,17 @@ describe('cp integration', function()
nvim_input = function() end, nvim_input = function() end,
}) })
vim.cmd = function(cmd_str) local cmd_table = {
split = function() end,
vsplit = function() end,
diffthis = function() end,
e = function() end,
startinsert = function() end,
stopinsert = function() end,
}
vim.cmd = setmetatable(cmd_table, {
__call = function(_, cmd_str)
if cmd_str == 'silent only' then if cmd_str == 'silent only' then
return return
end end
@ -101,7 +111,10 @@ describe('cp integration', function()
if cmd_str == 'stopinsert' then if cmd_str == 'stopinsert' then
return return
end end
end end,
__index = cmd_table,
__newindex = cmd_table,
})
vim.schedule = function(fn) vim.schedule = function(fn)
fn() fn()

View file

@ -29,6 +29,10 @@ describe('cp test panel', function()
return nil return nil
end, end,
set_test_cases = function() end, set_test_cases = function() end,
get_contest_data = function()
return nil
end,
set_contest_data = function() end,
} }
package.loaded['cp.cache'] = mock_cache package.loaded['cp.cache'] = mock_cache