mirror of
https://github.com/neovim/neovim.git
synced 2025-11-04 09:44:31 +00:00
path_fix_case: unit test
This commit is contained in:
committed by
Thiago de Arruda
parent
0f4976687d
commit
93bfe6a400
@@ -418,6 +418,30 @@ describe('more path function', function()
|
|||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
describe('path_fix_case', function()
|
||||||
|
function fix_case(file)
|
||||||
|
c_file = to_cstr(file)
|
||||||
|
path.path_fix_case(c_file)
|
||||||
|
return ffi.string(c_file)
|
||||||
|
end
|
||||||
|
|
||||||
|
if ffi.os == 'Windows' or ffi.os == 'OSX' then
|
||||||
|
it('Corrects the case of file names in Mac and Windows', function()
|
||||||
|
lfs.mkdir('CamelCase')
|
||||||
|
eq('CamelCase', fix_case('camelcase'))
|
||||||
|
eq('CamelCase', fix_case('cAMELcASE'))
|
||||||
|
lfs.rmdir('CamelCase')
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
it('does nothing on Linux', function()
|
||||||
|
lfs.mkdir('CamelCase')
|
||||||
|
eq('camelcase', fix_case('camelcase'))
|
||||||
|
eq('cAMELcASE', fix_case('cAMELcASE'))
|
||||||
|
lfs.mkdir('CamelCase')
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
describe('append_path', function()
|
describe('append_path', function()
|
||||||
it('joins given paths with a slash', function()
|
it('joins given paths with a slash', function()
|
||||||
local path1 = cstr(100, 'path1')
|
local path1 = cstr(100, 'path1')
|
||||||
|
|||||||
Reference in New Issue
Block a user