aboutsummaryrefslogtreecommitdiff
path: root/test/unit/path_spec.lua
diff options
context:
space:
mode:
authorScott Prager <splinterofchaos@gmail.com>2015-03-26 23:01:07 -0400
committerThiago de Arruda <tpadilha84@gmail.com>2015-03-31 11:20:24 -0300
commit93bfe6a4009363e822c4895d28ead42f224aebfe (patch)
tree114836b669a84d66b862079ac17e019e1427de1c /test/unit/path_spec.lua
parent0f4976687d0dfc3a0992195219586be93e49dc9e (diff)
downloadrneovim-93bfe6a4009363e822c4895d28ead42f224aebfe.tar.gz
rneovim-93bfe6a4009363e822c4895d28ead42f224aebfe.tar.bz2
rneovim-93bfe6a4009363e822c4895d28ead42f224aebfe.zip
path_fix_case: unit test
Diffstat (limited to 'test/unit/path_spec.lua')
-rw-r--r--test/unit/path_spec.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unit/path_spec.lua b/test/unit/path_spec.lua
index 1824eaeccc..13546a6183 100644
--- a/test/unit/path_spec.lua
+++ b/test/unit/path_spec.lua
@@ -418,6 +418,30 @@ describe('more path function', function()
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()
it('joins given paths with a slash', function()
local path1 = cstr(100, 'path1')