fix(ci): fix tests besides pane;
This commit is contained in:
parent
9dd51374fe
commit
d3414f3b7b
4 changed files with 19 additions and 10 deletions
|
|
@ -126,7 +126,7 @@ function M.setup(user_config)
|
||||||
end
|
end
|
||||||
|
|
||||||
if user_config.scrapers then
|
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
|
if not vim.tbl_contains(constants.PLATFORMS, contest_name) then
|
||||||
error(
|
error(
|
||||||
("Invalid contest '%s' in scrapers config. Valid contests: %s"):format(
|
("Invalid contest '%s' in scrapers config. Valid contests: %s"):format(
|
||||||
|
|
@ -135,11 +135,6 @@ function M.setup(user_config)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
end
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,14 @@ describe('cp command parsing', function()
|
||||||
cp = require('cp')
|
cp = require('cp')
|
||||||
cp.setup({
|
cp.setup({
|
||||||
contests = {
|
contests = {
|
||||||
atcoder = { default_language = 'cpp' },
|
atcoder = {
|
||||||
cses = { default_language = 'cpp' },
|
default_language = 'cpp',
|
||||||
|
cpp = { extension = 'cpp' },
|
||||||
|
},
|
||||||
|
cses = {
|
||||||
|
default_language = 'cpp',
|
||||||
|
cpp = { extension = 'cpp' },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -195,10 +195,11 @@ describe('cp.execute', function()
|
||||||
execute.compile_generic(language_config, { binary_file = './test.run' })
|
execute.compile_generic(language_config, { binary_file = './test.run' })
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('handles execution timeouts', function()
|
it('handles command execution', function()
|
||||||
vim.system = function(_, opts)
|
vim.system = function(_, opts)
|
||||||
|
-- Compilation doesn't set timeout, only text=true
|
||||||
if opts then
|
if opts then
|
||||||
assert.is_not_nil(opts.timeout)
|
assert.equals(true, opts.text)
|
||||||
end
|
end
|
||||||
return {
|
return {
|
||||||
wait = function()
|
wait = function()
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,15 @@ describe('cp.health', function()
|
||||||
isdirectory = function()
|
isdirectory = function()
|
||||||
return 1
|
return 1
|
||||||
end,
|
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')
|
health = require('cp.health')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue