fix(ci): unused vars

This commit is contained in:
Barrett Ruth 2025-09-21 11:37:08 -04:00
parent 2c994a8bdc
commit c1529c5d91
4 changed files with 18 additions and 5 deletions

View file

@ -82,6 +82,11 @@ local function contest_picker(platform)
problem_picker(platform, contest.id)
end
end,
['ctrl-r'] = function()
local cache = require('cp.cache')
cache.clear_contest_list(platform)
contest_picker(platform)
end,
},
})
end

View file

@ -75,7 +75,7 @@ local function contest_picker(opts, platform)
end,
}),
sorter = conf.generic_sorter(opts),
attach_mappings = function(prompt_bufnr)
attach_mappings = function(prompt_bufnr, map)
actions.select_default:replace(function()
local selection = action_state.get_selected_entry()
actions.close(prompt_bufnr)
@ -84,6 +84,14 @@ local function contest_picker(opts, platform)
problem_picker(opts, platform, selection.value.id)
end
end)
map('i', '<C-r>', function()
local cache = require('cp.cache')
cache.clear_contest_list(platform)
actions.close(prompt_bufnr)
contest_picker(opts, platform)
end)
return true
end,
})

View file

@ -106,7 +106,7 @@ describe('cp.picker', function()
it('returns problems from cache when available', function()
local cache = require('cp.cache')
cache.load = function() end
cache.get_contest_data = function(platform, contest_id)
cache.get_contest_data = function()
return {
problems = {
{ id = 'a', name = 'Problem A' },
@ -131,7 +131,7 @@ describe('cp.picker', function()
cache.get_contest_data = function()
return nil
end
scrape.scrape_contest_metadata = function(platform, contest_id)
scrape.scrape_contest_metadata = function()
return {
success = true,
problems = {
@ -154,7 +154,7 @@ describe('cp.picker', function()
cache.get_contest_data = function()
return nil
end
scrape.scrape_contest_metadata = function(platform, contest_id)
scrape.scrape_contest_metadata = function()
return {
success = false,
error = 'test error',

View file

@ -14,7 +14,7 @@ describe('cp.telescope', function()
package.preload['telescope.pickers'] = function()
return {
new = function(opts, picker_opts)
new = function()
return {
find = function() end,
}