diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-10-11 07:24:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-11 07:24:37 +0800 |
commit | 4eea60939f9c079d4e1652e0ed1724c4f2ab6eda (patch) | |
tree | 23e9035f4900de8d4c1a32950cecd2dbc8502f94 | |
parent | c4f8be464c99090dabc6376222830dffe0bf5b12 (diff) | |
download | rneovim-4eea60939f9c079d4e1652e0ed1724c4f2ab6eda.tar.gz rneovim-4eea60939f9c079d4e1652e0ed1724c4f2ab6eda.tar.bz2 rneovim-4eea60939f9c079d4e1652e0ed1724c4f2ab6eda.zip |
test(core/path_spec): don't use fnameescape() (#25593)
Using fnameescape() for the path argument of findfile() and finddir() is
wrong, as fnameescape() is intended to be used for parts of Ex commands,
not function arguments.
-rw-r--r-- | test/functional/core/path_spec.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/functional/core/path_spec.lua b/test/functional/core/path_spec.lua index 215217e771..268d557691 100644 --- a/test/functional/core/path_spec.lua +++ b/test/functional/core/path_spec.lua @@ -4,6 +4,7 @@ local command = helpers.command local eq = helpers.eq local eval = helpers.eval local feed = helpers.feed +local funcs = helpers.funcs local insert = helpers.insert local is_os = helpers.is_os local mkdir = helpers.mkdir @@ -152,18 +153,18 @@ describe('file search with vim functions', function() else write_file(expected, '') end - eq(expected, eval('find'..option..'(fnameescape(\''..item..'\'),fnameescape(\''..folder_path..'\'))')) + eq(expected, funcs['find' .. option](item, folder_path:gsub(' ', [[\ ]]))) end it('finddir()', function() test_find_func('dir', 'directory', 'folder') - -- test_find_func('dir', 'directory', 'folder name') - test_find_func('dir', 'folder name', 'directory') + test_find_func('dir', 'directory', 'folder name') + test_find_func('dir', 'fold#er name', 'directory') end) it('findfile()', function() test_find_func('file', 'directory', 'file.txt') - -- test_find_func('file', 'directory', 'file name.txt') - test_find_func('file', 'folder name', 'file.txt') + test_find_func('file', 'directory', 'file name.txt') + test_find_func('file', 'fold#er name', 'file.txt') end) end) |