commit b6219210745c67899900bae9f12dd231c9857e37
parent 67bb0cfa79bc7eea5103ce9a00fc6176077c135b
Author: futsuuu <futsuuu123@gmail.com>
Date: Tue, 23 Jul 2024 20:40:43 +0900
test: add a test to check the indentation
Diffstat:
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git a/test/functional/lua/loader_spec.lua b/test/functional/lua/loader_spec.lua
@@ -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)