fix(runtime): respect 'fileignorecase' when sourcing (#24344)

This commit is contained in:
zeertzjq
2023-07-14 07:57:13 +08:00
committed by GitHub
parent dbb840da01
commit 9176b5e10a
5 changed files with 40 additions and 23 deletions

View File

@@ -15,6 +15,7 @@ local mkdir = helpers.mkdir
cimport('string.h')
local cimp = cimport('./src/nvim/os/os.h', './src/nvim/path.h')
local options = cimport('./src/nvim/option_defs.h')
local length = 0
local buffer = nil
@@ -636,6 +637,15 @@ describe('path.c', function()
eq(false, path_with_extension('/some/path/file.vim', 'lua'))
eq(false, path_with_extension('/some/path/file', 'lua'))
end)
itp("respects 'fileignorecase' option", function()
options.p_fic = false
eq(false, path_with_extension('/some/path/file.VIM', 'vim'))
eq(false, path_with_extension('/some/path/file.LUA', 'lua'))
options.p_fic = true
eq(true, path_with_extension('/some/path/file.VIM', 'vim'))
eq(true, path_with_extension('/some/path/file.LUA', 'lua'))
end)
end)
describe('path_with_url', function()