Skip to content

Commit

Permalink
test(extra): adjust to pass on Nightly
Browse files Browse the repository at this point in the history
Details:
- There seems to be new commands added.
- An ongoing options rewrite seems to have made it impossible for
  `vim.o`/`vim.bo`/`vim.wo` to error for option name that is listed in
  the `vim.api.nvim_get_all_options_info()`.
  • Loading branch information
echasnovski committed Nov 8, 2024
1 parent 4fad564 commit 998cfcf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions lua/mini/extra.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,7 @@ MiniExtra.pickers.options = function(local_opts, opts)
local has_value, value = pcall(function()
return vim.api.nvim_win_call(target_win_id, function() return vim[value_source][item.info.name] end)
end)
-- TODO: consider removing after Neovim<=0.10 compatibility is dropped
if not has_value then value = '<Option is deprecated (will be removed in later Neovim versions)>' end

local lines = { 'Value:', unpack(vim.split(vim.inspect(value), '\n')), '', 'Info:' }
Expand Down
10 changes: 6 additions & 4 deletions tests/test_extra.lua
Original file line number Diff line number Diff line change
Expand Up @@ -904,12 +904,12 @@ T['pickers']['commands()']['works'] = function()
child.lua_notify('_G.return_item = MiniExtra.pickers.commands()')
validate_picker_name('Commands')
type_keys("'chdir")
child.expect_screenshot()
child.expect_screenshot({ ignore_lines = { 9 } })

-- Should have proper preview
type_keys('<Tab>')
-- - No data for built-in commands is yet available
child.expect_screenshot()
child.expect_screenshot({ ignore_lines = { 9 } })

-- Should properly choose
type_keys('<CR>')
Expand All @@ -932,9 +932,9 @@ T['pickers']['commands()']['respects user commands'] = function()

-- Should have proper preview with data
type_keys('<Tab>')
child.expect_screenshot()
child.expect_screenshot({ ignore_lines = { 24 } })
type_keys('<C-n>')
child.expect_screenshot()
child.expect_screenshot({ ignore_lines = { 24 } })

-- Should on choose execute command if it is without arguments
type_keys('<C-p>', '<CR>')
Expand Down Expand Up @@ -2943,6 +2943,8 @@ T['pickers']['options()']['correctly chooses non-binary options'] = function()
end

T['pickers']['options()']['correctly previews deprecated options'] = function()
-- There shouldn't be "deprecated" options listed after Neovim 0.11 refactors
if child.fn.has('nvim-0.11') == 1 then return end
child.set_size(10, 115)
pick_options()
type_keys('^aleph', '<Tab>')
Expand Down

0 comments on commit 998cfcf

Please sign in to comment.