fix(ci): fix tests besides pane;

This commit is contained in:
Barrett Ruth 2025-09-18 23:42:27 -04:00
parent 9dd51374fe
commit d3414f3b7b
4 changed files with 19 additions and 10 deletions

View file

@ -126,7 +126,7 @@ function M.setup(user_config)
end
if user_config.scrapers then
for contest_name, enabled in pairs(user_config.scrapers) do
for _, contest_name in ipairs(user_config.scrapers) do
if not vim.tbl_contains(constants.PLATFORMS, contest_name) then
error(
("Invalid contest '%s' in scrapers config. Valid contests: %s"):format(
@ -135,11 +135,6 @@ function M.setup(user_config)
)
)
end
if type(enabled) ~= 'boolean' then
error(
("Scraper setting for '%s' must be boolean, got %s"):format(contest_name, type(enabled))
)
end
end
end
end

View file

@ -15,8 +15,14 @@ describe('cp command parsing', function()
cp = require('cp')
cp.setup({
contests = {
atcoder = { default_language = 'cpp' },
cses = { default_language = 'cpp' },
atcoder = {
default_language = 'cpp',
cpp = { extension = 'cpp' },
},
cses = {
default_language = 'cpp',
cpp = { extension = 'cpp' },
},
},
})
end)

View file

@ -195,10 +195,11 @@ describe('cp.execute', function()
execute.compile_generic(language_config, { binary_file = './test.run' })
end)
it('handles execution timeouts', function()
it('handles command execution', function()
vim.system = function(_, opts)
-- Compilation doesn't set timeout, only text=true
if opts then
assert.is_not_nil(opts.timeout)
assert.equals(true, opts.text)
end
return {
wait = function()

View file

@ -15,8 +15,15 @@ describe('cp.health', function()
isdirectory = function()
return 1
end,
fnamemodify = function()
return '/test/path'
end,
})
vim.system = function()
return { wait = function() return { code = 0, stdout = 'test version\n' } end }
end
health = require('cp.health')
end)