test: add a test to check the indentation

This commit is contained in:
futsuuu 2024-07-23 20:40:43 +09:00 committed by Lewis Russell
parent 67bb0cfa79
commit b621921074

View File

@ -88,4 +88,18 @@ describe('vim.loader', function()
eq(1, exec_lua('return loadfile(...)()', tmp1))
eq(2, exec_lua('return loadfile(...)()', tmp2))
end)
it('correct indent on error message (#29809)', function()
exec_lua [[
vim.loader.enable()
local success, errmsg = pcall(require, 'non_existent_module')
assert(not success)
errmsg = errmsg:gsub("^module 'non_existent_module' not found:\n", '')
for line in vim.gsplit(errmsg, '\n') do
assert(line:find('^\t'), ('not indented: %q'):format(line))
end
]]
end)
end)