diff options
-rw-r--r-- | test/functional/eval/fnamemodify_spec.lua | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/test/functional/eval/fnamemodify_spec.lua b/test/functional/eval/fnamemodify_spec.lua index 52dfe1a55f..fe6b50a544 100644 --- a/test/functional/eval/fnamemodify_spec.lua +++ b/test/functional/eval/fnamemodify_spec.lua @@ -18,24 +18,18 @@ describe('fnamemodify()', function() end) it('works', function() + local root = helpers.pathroot() + eq(root, fnamemodify([[/]], ':p:h')) + eq(root, fnamemodify([[/]], ':p')) if iswin() then - local drive_f = io.popen('for %P in (%CD%) do @echo %~dP', 'r') - local drive = string.gsub(drive_f:read('*a'), '[\n\r]', '') - drive_f:close() - local root = drive..[[\]] eq(root, fnamemodify([[\]], ':p:h')) eq(root, fnamemodify([[\]], ':p')) - eq(root, fnamemodify([[/]], ':p:h')) - eq(root, fnamemodify([[/]], ':p')) command('set shellslash') - root = drive..[[/]] + root = string.sub(root, 1, -2)..'/' eq(root, fnamemodify([[\]], ':p:h')) eq(root, fnamemodify([[\]], ':p')) eq(root, fnamemodify([[/]], ':p:h')) eq(root, fnamemodify([[/]], ':p')) - else - eq('/', fnamemodify([[/]], ':p:h')) - eq('/', fnamemodify([[/]], ':p')) end end) |