aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/api/vim_spec.lua147
-rw-r--r--test/functional/editor/tabpage_spec.lua11
-rw-r--r--test/functional/fixtures/fake-lsp-server.lua15
-rw-r--r--test/functional/options/defaults_spec.lua96
-rw-r--r--test/functional/plugin/lsp_spec.lua21
-rw-r--r--test/symbolic/klee/nvim/keymap.c2
-rw-r--r--test/symbolic/klee/viml_expressions_lexer.c2
-rw-r--r--test/symbolic/klee/viml_expressions_parser.c2
-rw-r--r--test/unit/keycodes_spec.lua (renamed from test/unit/keymap_spec.lua)4
9 files changed, 265 insertions, 35 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index d68f299277..f39aa2f20b 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -1,5 +1,6 @@
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
+local lfs = require('lfs')
local fmt = string.format
local assert_alive = helpers.assert_alive
@@ -25,6 +26,7 @@ local tmpname = helpers.tmpname
local write_file = helpers.write_file
local exec_lua = helpers.exec_lua
local exc_exec = helpers.exc_exec
+local insert = helpers.insert
local pcall_err = helpers.pcall_err
local format_string = helpers.format_string
@@ -3473,4 +3475,149 @@ describe('API', function()
pcall_err(meths.parse_cmd, '4,6Fubar', {}))
end)
end)
+ describe('nvim_cmd', function()
+ it('works', function ()
+ meths.cmd({ cmd = "set", args = { "cursorline" } }, {})
+ eq(true, meths.get_option_value("cursorline", {}))
+ end)
+ it('captures output', function()
+ eq("foo", meths.cmd({ cmd = "echo", args = { '"foo"' } }, { output = true }))
+ end)
+ it('sets correct script context', function()
+ meths.cmd({ cmd = "set", args = { "cursorline" } }, {})
+ local str = meths.exec([[verbose set cursorline?]], true)
+ neq(nil, str:find("cursorline\n\tLast set from API client %(channel id %d+%)"))
+ end)
+ it('works with range', function()
+ insert [[
+ line1
+ line2
+ line3
+ line4
+ you didn't expect this
+ line5
+ line6
+ ]]
+ meths.cmd({ cmd = "del", range = {2, 4} }, {})
+ expect [[
+ line1
+ you didn't expect this
+ line5
+ line6
+ ]]
+ end)
+ it('works with count', function()
+ insert [[
+ line1
+ line2
+ line3
+ line4
+ you didn't expect this
+ line5
+ line6
+ ]]
+ meths.cmd({ cmd = "del", range = { 2 }, count = 4 }, {})
+ expect [[
+ line1
+ line5
+ line6
+ ]]
+ end)
+ it('works with register', function()
+ insert [[
+ line1
+ line2
+ line3
+ line4
+ you didn't expect this
+ line5
+ line6
+ ]]
+ meths.cmd({ cmd = "del", range = { 2, 4 }, reg = 'a' }, {})
+ meths.exec("1put a", false)
+ expect [[
+ line1
+ line2
+ line3
+ line4
+ you didn't expect this
+ line5
+ line6
+ ]]
+ end)
+ it('works with bang', function ()
+ meths.create_user_command("Foo", 'echo "<bang>"', { bang = true })
+ eq("!", meths.cmd({ cmd = "Foo", bang = true }, { output = true }))
+ eq("", meths.cmd({ cmd = "Foo", bang = false }, { output = true }))
+ end)
+ it('works with modifiers', function()
+ meths.create_user_command("Foo", 'set verbose', {})
+ eq(" verbose=1", meths.cmd({ cmd = "Foo", mods = { verbose = 1 } }, { output = true }))
+ eq(0, meths.get_option_value("verbose", {}))
+ end)
+ it('works with magic.file', function()
+ exec_lua([[
+ vim.api.nvim_create_user_command("Foo", function(opts)
+ vim.api.nvim_echo({{ opts.fargs[1] }}, false, {})
+ end, { nargs = 1 })
+ ]])
+ eq(lfs.currentdir(),
+ meths.cmd({ cmd = "Foo", args = { '%:p:h' }, magic = { file = true } },
+ { output = true }))
+ end)
+ it('splits arguments correctly', function()
+ meths.exec([[
+ function! FooFunc(...)
+ echo a:000
+ endfunction
+ ]], false)
+ meths.create_user_command("Foo", "call FooFunc(<f-args>)", { nargs = '+' })
+ eq([=[['a quick', 'brown fox', 'jumps over the', 'lazy dog']]=],
+ meths.cmd({ cmd = "Foo", args = { "a quick", "brown fox", "jumps over the", "lazy dog"}},
+ { output = true }))
+ eq([=[['test \ \\ \"""\', 'more\ tests\" ']]=],
+ meths.cmd({ cmd = "Foo", args = { [[test \ \\ \"""\]], [[more\ tests\" ]] } },
+ { output = true }))
+ end)
+ it('splits arguments correctly for Lua callback', function()
+ meths.exec_lua([[
+ local function FooFunc(opts)
+ vim.pretty_print(opts.fargs)
+ end
+
+ vim.api.nvim_create_user_command("Foo", FooFunc, { nargs = '+' })
+ ]], {})
+ eq([[{ "a quick", "brown fox", "jumps over the", "lazy dog" }]],
+ meths.cmd({ cmd = "Foo", args = { "a quick", "brown fox", "jumps over the", "lazy dog"}},
+ { output = true }))
+ eq([[{ 'test \\ \\\\ \\"""\\', 'more\\ tests\\" ' }]],
+ meths.cmd({ cmd = "Foo", args = { [[test \ \\ \"""\]], [[more\ tests\" ]] } },
+ { output = true }))
+ end)
+ it('works with buffer names', function()
+ command("edit foo.txt | edit bar.txt")
+ meths.cmd({ cmd = "buffer", args = { "foo.txt" } }, {})
+ eq("foo.txt", funcs.fnamemodify(meths.buf_get_name(0), ":t"))
+ meths.cmd({ cmd = "buffer", args = { "bar.txt" } }, {})
+ eq("bar.txt", funcs.fnamemodify(meths.buf_get_name(0), ":t"))
+ end)
+ it('triggers CmdUndefined event if command is not found', function()
+ meths.exec_lua([[
+ vim.api.nvim_create_autocmd("CmdUndefined",
+ { pattern = "Foo",
+ callback = function()
+ vim.api.nvim_create_user_command("Foo", "echo 'foo'", {})
+ end
+ })
+ ]], {})
+ eq("foo", meths.cmd({ cmd = "Foo" }, { output = true }))
+ end)
+ it('errors if command is not implemented', function()
+ eq("Command not implemented: popup", pcall_err(meths.cmd, { cmd = "popup" }, {}))
+ end)
+ it('works with empty arguments list', function()
+ meths.cmd({ cmd = "update" }, {})
+ meths.cmd({ cmd = "buffer", count = 0 }, {})
+ end)
+ end)
end)
diff --git a/test/functional/editor/tabpage_spec.lua b/test/functional/editor/tabpage_spec.lua
index 2494daf99b..3b2c1db350 100644
--- a/test/functional/editor/tabpage_spec.lua
+++ b/test/functional/editor/tabpage_spec.lua
@@ -7,6 +7,7 @@ local neq = helpers.neq
local feed = helpers.feed
local eval = helpers.eval
local exec = helpers.exec
+local funcs = helpers.funcs
describe('tabpage', function()
before_each(clear)
@@ -51,5 +52,13 @@ describe('tabpage', function()
]])
neq(999, eval('g:win_closed'))
end)
-end)
+ it(":tabmove handles modifiers and addr", function()
+ command('tabnew | tabnew | tabnew')
+ eq(4, funcs.nvim_tabpage_get_number(0))
+ command(' silent :keepalt :: ::: silent! - tabmove')
+ eq(3, funcs.nvim_tabpage_get_number(0))
+ command(' silent :keepalt :: ::: silent! -2 tabmove')
+ eq(1, funcs.nvim_tabpage_get_number(0))
+ end)
+end)
diff --git a/test/functional/fixtures/fake-lsp-server.lua b/test/functional/fixtures/fake-lsp-server.lua
index f589f5955f..86cdf4ef56 100644
--- a/test/functional/fixtures/fake-lsp-server.lua
+++ b/test/functional/fixtures/fake-lsp-server.lua
@@ -766,8 +766,21 @@ function tests.code_action_filter()
isPreferred = true,
command = 'preferred_command',
}
+ local quickfix_action = {
+ title = 'Action 3',
+ kind = 'quickfix',
+ command = 'quickfix_command',
+ }
+ local quickfix_foo_action = {
+ title = 'Action 4',
+ kind = 'quickfix.foo',
+ command = 'quickfix_foo_command',
+ }
+ expect_request('textDocument/codeAction', function()
+ return nil, { action, preferred_action, quickfix_action, quickfix_foo_action, }
+ end)
expect_request('textDocument/codeAction', function()
- return nil, { action, preferred_action, }
+ return nil, { action, preferred_action, quickfix_action, quickfix_foo_action, }
end)
notify('shutdown')
end;
diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua
index 6620c9acef..36a53d8d26 100644
--- a/test/functional/options/defaults_spec.lua
+++ b/test/functional/options/defaults_spec.lua
@@ -163,7 +163,7 @@ describe('startup defaults', function()
end)
it("'shadafile' ('viminfofile')", function()
- local env = {XDG_DATA_HOME='Xtest-userdata', XDG_CONFIG_HOME='Xtest-userconfig'}
+ local env = {XDG_DATA_HOME='Xtest-userdata', XDG_STATE_HOME='Xtest-userstate', XDG_CONFIG_HOME='Xtest-userconfig'}
clear{args={}, args_rm={'-i'}, env=env}
-- Default 'shadafile' is empty.
-- This means use the default location. :help shada-file-name
@@ -178,7 +178,7 @@ describe('startup defaults', function()
clear{args={}, args_rm={'-i'}, env=env}
eq({ f }, eval('v:oldfiles'))
os.remove('Xtest-foo')
- rmdir('Xtest-userdata')
+ rmdir('Xtest-userstate')
-- Handles viminfo/viminfofile as alias for shada/shadafile.
eq('\n shadafile=', eval('execute("set shadafile?")'))
@@ -206,7 +206,7 @@ describe('startup defaults', function()
describe('$NVIM_LOG_FILE', function()
local xdgdir = 'Xtest-startup-xdg-logpath'
- local xdgcachedir = xdgdir..'/nvim'
+ local xdgstatedir = xdgdir..'/nvim'
after_each(function()
os.remove('Xtest-logpath')
rmdir(xdgdir)
@@ -218,21 +218,21 @@ describe('startup defaults', function()
}})
eq('Xtest-logpath', eval('$NVIM_LOG_FILE'))
end)
- it('defaults to stdpath("cache")/log if empty', function()
- eq(true, mkdir(xdgdir) and mkdir(xdgcachedir))
+ it('defaults to stdpath("log")/log if empty', function()
+ eq(true, mkdir(xdgdir) and mkdir(xdgstatedir))
clear({env={
- XDG_CACHE_HOME=xdgdir,
+ XDG_STATE_HOME=xdgdir,
NVIM_LOG_FILE='', -- Empty is invalid.
}})
- eq(xdgcachedir..'/log', string.gsub(eval('$NVIM_LOG_FILE'), '\\', '/'))
+ eq(xdgstatedir..'/log', string.gsub(eval('$NVIM_LOG_FILE'), '\\', '/'))
end)
- it('defaults to stdpath("cache")/log if invalid', function()
- eq(true, mkdir(xdgdir) and mkdir(xdgcachedir))
+ it('defaults to stdpath("log")/log if invalid', function()
+ eq(true, mkdir(xdgdir) and mkdir(xdgstatedir))
clear({env={
- XDG_CACHE_HOME=xdgdir,
+ XDG_STATE_HOME=xdgdir,
NVIM_LOG_FILE='.', -- Any directory is invalid.
}})
- eq(xdgcachedir..'/log', string.gsub(eval('$NVIM_LOG_FILE'), '\\', '/'))
+ eq(xdgstatedir..'/log', string.gsub(eval('$NVIM_LOG_FILE'), '\\', '/'))
end)
end)
end)
@@ -264,6 +264,7 @@ describe('XDG-based defaults', function()
XDG_CONFIG_HOME=nil,
XDG_DATA_HOME=nil,
XDG_CACHE_HOME=nil,
+ XDG_STATE_HOME=nil,
XDG_RUNTIME_DIR=nil,
XDG_CONFIG_DIRS=nil,
XDG_DATA_DIRS=nil,
@@ -293,6 +294,7 @@ describe('XDG-based defaults', function()
local env_sep = iswin() and ';' or ':'
local data_dir = iswin() and 'nvim-data' or 'nvim'
+ local state_dir = iswin() and 'nvim-data' or 'nvim'
local root_path = iswin() and 'C:' or ''
describe('with too long XDG variables', function()
@@ -303,6 +305,7 @@ describe('XDG-based defaults', function()
.. env_sep.. root_path .. ('/b'):rep(2048)
.. (env_sep .. root_path .. '/c'):rep(512)),
XDG_DATA_HOME=(root_path .. ('/X'):rep(4096)),
+ XDG_STATE_HOME=(root_path .. ('/X'):rep(4096)),
XDG_DATA_DIRS=(root_path .. ('/A'):rep(2048)
.. env_sep .. root_path .. ('/B'):rep(2048)
.. (env_sep .. root_path .. '/C'):rep(512)),
@@ -355,13 +358,13 @@ describe('XDG-based defaults', function()
.. ',' .. root_path .. ('/a'):rep(2048) .. '/nvim/after'
.. ',' .. root_path .. ('/x'):rep(4096) .. '/nvim/after'
):gsub('\\', '/')), (meths.get_option('runtimepath')):gsub('\\', '/'))
- eq('.,' .. root_path .. ('/X'):rep(4096).. '/' .. data_dir .. '/backup//',
+ eq('.,' .. root_path .. ('/X'):rep(4096).. '/' .. state_dir .. '/backup//',
(meths.get_option('backupdir'):gsub('\\', '/')))
- eq(root_path .. ('/X'):rep(4096) .. '/' .. data_dir .. '/swap//',
+ eq(root_path .. ('/X'):rep(4096) .. '/' .. state_dir .. '/swap//',
(meths.get_option('directory')):gsub('\\', '/'))
- eq(root_path .. ('/X'):rep(4096) .. '/' .. data_dir .. '/undo//',
+ eq(root_path .. ('/X'):rep(4096) .. '/' .. state_dir .. '/undo//',
(meths.get_option('undodir')):gsub('\\', '/'))
- eq(root_path .. ('/X'):rep(4096) .. '/' .. data_dir .. '/view//',
+ eq(root_path .. ('/X'):rep(4096) .. '/' .. state_dir .. '/view//',
(meths.get_option('viewdir')):gsub('\\', '/'))
end)
end)
@@ -372,6 +375,7 @@ describe('XDG-based defaults', function()
XDG_CONFIG_HOME='$XDG_DATA_HOME',
XDG_CONFIG_DIRS='$XDG_DATA_DIRS',
XDG_DATA_HOME='$XDG_CONFIG_HOME',
+ XDG_STATE_HOME='$XDG_CONFIG_HOME',
XDG_DATA_DIRS='$XDG_CONFIG_DIRS',
}})
end)
@@ -405,13 +409,13 @@ describe('XDG-based defaults', function()
.. ',$XDG_DATA_DIRS/nvim/after'
.. ',$XDG_DATA_HOME/nvim/after'
):gsub('\\', '/')), (meths.get_option('runtimepath')):gsub('\\', '/'))
- eq(('.,$XDG_CONFIG_HOME/' .. data_dir .. '/backup//'),
+ eq(('.,$XDG_CONFIG_HOME/' .. state_dir .. '/backup//'),
meths.get_option('backupdir'):gsub('\\', '/'))
- eq(('$XDG_CONFIG_HOME/' .. data_dir .. '/swap//'),
+ eq(('$XDG_CONFIG_HOME/' .. state_dir .. '/swap//'),
meths.get_option('directory'):gsub('\\', '/'))
- eq(('$XDG_CONFIG_HOME/' .. data_dir .. '/undo//'),
+ eq(('$XDG_CONFIG_HOME/' .. state_dir .. '/undo//'),
meths.get_option('undodir'):gsub('\\', '/'))
- eq(('$XDG_CONFIG_HOME/' .. data_dir .. '/view//'),
+ eq(('$XDG_CONFIG_HOME/' .. state_dir .. '/view//'),
meths.get_option('viewdir'):gsub('\\', '/'))
meths.command('set all&')
eq(('$XDG_DATA_HOME/nvim'
@@ -425,13 +429,13 @@ describe('XDG-based defaults', function()
.. ',$XDG_DATA_DIRS/nvim/after'
.. ',$XDG_DATA_HOME/nvim/after'
):gsub('\\', '/'), (meths.get_option('runtimepath')):gsub('\\', '/'))
- eq(('.,$XDG_CONFIG_HOME/' .. data_dir .. '/backup//'),
+ eq(('.,$XDG_CONFIG_HOME/' .. state_dir .. '/backup//'),
meths.get_option('backupdir'):gsub('\\', '/'))
- eq(('$XDG_CONFIG_HOME/' .. data_dir .. '/swap//'),
+ eq(('$XDG_CONFIG_HOME/' .. state_dir .. '/swap//'),
meths.get_option('directory'):gsub('\\', '/'))
- eq(('$XDG_CONFIG_HOME/' .. data_dir .. '/undo//'),
+ eq(('$XDG_CONFIG_HOME/' .. state_dir .. '/undo//'),
meths.get_option('undodir'):gsub('\\', '/'))
- eq(('$XDG_CONFIG_HOME/' .. data_dir .. '/view//'),
+ eq(('$XDG_CONFIG_HOME/' .. state_dir .. '/view//'),
meths.get_option('viewdir'):gsub('\\', '/'))
end)
end)
@@ -442,6 +446,7 @@ describe('XDG-based defaults', function()
XDG_CONFIG_HOME=', , ,',
XDG_CONFIG_DIRS=',-,-,' .. env_sep .. '-,-,-',
XDG_DATA_HOME=',=,=,',
+ XDG_STATE_HOME=',=,=,',
XDG_DATA_DIRS=',≡,≡,' .. env_sep .. '≡,≡,≡',
}})
end)
@@ -484,13 +489,13 @@ describe('XDG-based defaults', function()
.. ',\\,-\\,-\\,' .. path_sep ..'nvim' .. path_sep ..'after'
.. ',\\, \\, \\,' .. path_sep ..'nvim' .. path_sep ..'after'
), meths.get_option('runtimepath'))
- eq('.,\\,=\\,=\\,' .. path_sep .. data_dir .. '' .. path_sep ..'backup' .. (path_sep):rep(2),
+ eq('.,\\,=\\,=\\,' .. path_sep .. state_dir .. '' .. path_sep ..'backup' .. (path_sep):rep(2),
meths.get_option('backupdir'))
- eq('\\,=\\,=\\,' .. path_sep ..'' .. data_dir .. '' .. path_sep ..'swap' .. (path_sep):rep(2),
+ eq('\\,=\\,=\\,' .. path_sep ..'' .. state_dir .. '' .. path_sep ..'swap' .. (path_sep):rep(2),
meths.get_option('directory'))
- eq('\\,=\\,=\\,' .. path_sep ..'' .. data_dir .. '' .. path_sep ..'undo' .. (path_sep):rep(2),
+ eq('\\,=\\,=\\,' .. path_sep ..'' .. state_dir .. '' .. path_sep ..'undo' .. (path_sep):rep(2),
meths.get_option('undodir'))
- eq('\\,=\\,=\\,' .. path_sep ..'' .. data_dir .. '' .. path_sep ..'view' .. (path_sep):rep(2),
+ eq('\\,=\\,=\\,' .. path_sep ..'' .. state_dir .. '' .. path_sep ..'view' .. (path_sep):rep(2),
meths.get_option('viewdir'))
end)
end)
@@ -499,8 +504,9 @@ end)
describe('stdpath()', function()
-- Windows appends 'nvim-data' instead of just 'nvim' to prevent collisions
- -- due to XDG_CONFIG_HOME and XDG_DATA_HOME being the same.
+ -- due to XDG_CONFIG_HOME, XDG_DATA_HOME and XDG_STATE_HOME being the same.
local datadir = iswin() and 'nvim-data' or 'nvim'
+ local statedir = iswin() and 'nvim-data' or 'nvim'
local env_sep = iswin() and ';' or ':'
it('acceptance', function()
@@ -509,6 +515,7 @@ describe('stdpath()', function()
eq('nvim', funcs.fnamemodify(funcs.stdpath('cache'), ':t'))
eq('nvim', funcs.fnamemodify(funcs.stdpath('config'), ':t'))
eq(datadir, funcs.fnamemodify(funcs.stdpath('data'), ':t'))
+ eq(statedir, funcs.fnamemodify(funcs.stdpath('state'), ':t'))
eq('table', type(funcs.stdpath('config_dirs')))
eq('table', type(funcs.stdpath('data_dirs')))
assert_alive() -- Check for crash. #8393
@@ -582,6 +589,39 @@ describe('stdpath()', function()
end)
end)
+ describe('with "state"' , function ()
+ it('knows XDG_STATE_HOME', function()
+ clear({env={
+ XDG_STATE_HOME=alter_slashes('/home/docwhat/.local'),
+ }})
+ eq(alter_slashes('/home/docwhat/.local/'..statedir), funcs.stdpath('state'))
+ end)
+
+ it('handles changes during runtime', function()
+ clear({env={
+ XDG_STATE_HOME=alter_slashes('/home/original'),
+ }})
+ eq(alter_slashes('/home/original/'..statedir), funcs.stdpath('state'))
+ command("let $XDG_STATE_HOME='"..alter_slashes('/home/new').."'")
+ eq(alter_slashes('/home/new/'..statedir), funcs.stdpath('state'))
+ end)
+
+ it("doesn't expand $VARIABLES", function()
+ clear({env={
+ XDG_STATE_HOME='$VARIABLES',
+ VARIABLES='this-should-not-happen',
+ }})
+ eq(alter_slashes('$VARIABLES/'..statedir), funcs.stdpath('state'))
+ end)
+
+ it("doesn't expand ~/", function()
+ clear({env={
+ XDG_STATE_HOME=alter_slashes('~/frobnitz'),
+ }})
+ eq(alter_slashes('~/frobnitz/'..statedir), funcs.stdpath('state'))
+ end)
+ end)
+
describe('with "cache"' , function ()
it('knows XDG_CACHE_HOME', function()
clear({env={
diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua
index 33a8976b79..4cb7636825 100644
--- a/test/functional/plugin/lsp_spec.lua
+++ b/test/functional/plugin/lsp_spec.lua
@@ -2753,12 +2753,33 @@ describe('LSP', function()
vim.lsp.commands['executed_preferred'] = function()
end
end
+ vim.lsp.commands['quickfix_command'] = function(cmd)
+ vim.lsp.commands['executed_quickfix'] = function()
+ end
+ end
local bufnr = vim.api.nvim_get_current_buf()
vim.lsp.buf_attach_client(bufnr, TEST_RPC_CLIENT_ID)
vim.lsp.buf.code_action({ filter = function(a) return a.isPreferred end, apply = true, })
+ vim.lsp.buf.code_action({
+ -- expect to be returned actions 'quickfix' and 'quickfix.foo'
+ context = { only = {'quickfix'}, },
+ apply = true,
+ filter = function(a)
+ if a.kind == 'quickfix.foo' then
+ vim.lsp.commands['filtered_quickfix_foo'] = function() end
+ return false
+ elseif a.kind == 'quickfix' then
+ return true
+ else
+ assert(nil, 'unreachable')
+ end
+ end,
+ })
]])
elseif ctx.method == 'shutdown' then
eq('function', exec_lua[[return type(vim.lsp.commands['executed_preferred'])]])
+ eq('function', exec_lua[[return type(vim.lsp.commands['filtered_quickfix_foo'])]])
+ eq('function', exec_lua[[return type(vim.lsp.commands['executed_quickfix'])]])
client.stop()
end
end
diff --git a/test/symbolic/klee/nvim/keymap.c b/test/symbolic/klee/nvim/keymap.c
index ed5f95a344..1f7f0e0911 100644
--- a/test/symbolic/klee/nvim/keymap.c
+++ b/test/symbolic/klee/nvim/keymap.c
@@ -1,7 +1,7 @@
#include <stdbool.h>
#include "nvim/types.h"
-#include "nvim/keymap.h"
+#include "nvim/keycodes.h"
#include "nvim/ascii.h"
#include "nvim/eval/typval.h"
diff --git a/test/symbolic/klee/viml_expressions_lexer.c b/test/symbolic/klee/viml_expressions_lexer.c
index ee7dc312e9..03c9d66ca4 100644
--- a/test/symbolic/klee/viml_expressions_lexer.c
+++ b/test/symbolic/klee/viml_expressions_lexer.c
@@ -17,7 +17,7 @@
#include "nvim/charset.c"
#include "nvim/garray.c"
#include "nvim/gettext.c"
-#include "nvim/keymap.c"
+#include "nvim/keycodes.c"
#include "nvim/viml/parser/expressions.c"
#define INPUT_SIZE 7
diff --git a/test/symbolic/klee/viml_expressions_parser.c b/test/symbolic/klee/viml_expressions_parser.c
index 9a876ed3fa..b0e1d71127 100644
--- a/test/symbolic/klee/viml_expressions_parser.c
+++ b/test/symbolic/klee/viml_expressions_parser.c
@@ -17,7 +17,7 @@
#include "nvim/garray.c"
#include "nvim/gettext.c"
#include "nvim/viml/parser/expressions.c"
-#include "nvim/keymap.c"
+#include "nvim/keycodes.c"
#define INPUT_SIZE 50
diff --git a/test/unit/keymap_spec.lua b/test/unit/keycodes_spec.lua
index 1f1f32bb9e..5bf27c9232 100644
--- a/test/unit/keymap_spec.lua
+++ b/test/unit/keycodes_spec.lua
@@ -5,10 +5,10 @@ local ffi = helpers.ffi
local eq = helpers.eq
local neq = helpers.neq
-local keymap = helpers.cimport('./src/nvim/keymap.h')
+local keymap = helpers.cimport('./src/nvim/keycodes.h')
local NULL = helpers.NULL
-describe('keymap.c', function()
+describe('keycodes.c', function()
describe('find_special_key()', function()
local srcp = ffi.new('const unsigned char *[1]')