aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2016-11-05 21:34:22 +0300
committerZyX <kp-pav@yandex.ru>2017-03-29 10:08:44 +0300
commit5239616297182601a5d244a482e6cef307e901f1 (patch)
tree7c5e735738b426080e97b1a465d4a63b4c7615a6
parent4bcee963471abd939bb9edd1709418e30be7290f (diff)
downloadrneovim-5239616297182601a5d244a482e6cef307e901f1.tar.gz
rneovim-5239616297182601a5d244a482e6cef307e901f1.tar.bz2
rneovim-5239616297182601a5d244a482e6cef307e901f1.zip
functests: Fix buf_functions test on Windows
-rw-r--r--test/functional/eval/buf_functions_spec.lua6
-rw-r--r--test/functional/helpers.lua5
2 files changed, 9 insertions, 2 deletions
diff --git a/test/functional/eval/buf_functions_spec.lua b/test/functional/eval/buf_functions_spec.lua
index a130da4452..db50874c53 100644
--- a/test/functional/eval/buf_functions_spec.lua
+++ b/test/functional/eval/buf_functions_spec.lua
@@ -13,6 +13,7 @@ local winmeths = helpers.winmeths
local curbufmeths = helpers.curbufmeths
local curwinmeths = helpers.curwinmeths
local curtabmeths = helpers.curtabmeths
+local get_pathsep = helpers.get_pathsep
local fname = 'Xtest-functional-eval-buf_functions'
local fname2 = fname .. '.2'
@@ -66,14 +67,15 @@ describe('bufname() function', function()
eq('', funcs.bufname('%')) -- Buffer has no name yet
command('file ' .. fname)
local wd = lfs.currentdir()
+ local sep = get_pathsep()
local curdirname = funcs.fnamemodify(wd, ':t')
for _, arg in ipairs({'%', 1, 'X', wd}) do
eq(fname, funcs.bufname(arg))
meths.set_current_dir('..')
- eq(curdirname .. '/' .. fname, funcs.bufname(arg))
+ eq(curdirname .. sep .. fname, funcs.bufname(arg))
meths.set_current_dir(curdirname)
meths.set_current_dir(dirname)
- eq(wd .. '/' .. fname, funcs.bufname(arg))
+ eq(wd .. sep .. fname, funcs.bufname(arg))
meths.set_current_dir('..')
eq(fname, funcs.bufname(arg))
command('enew')
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 13a0cff137..7ce95d0b7c 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -570,6 +570,10 @@ local curbufmeths = create_callindex(curbuf)
local curwinmeths = create_callindex(curwin)
local curtabmeths = create_callindex(curtab)
+local function get_pathsep()
+ return funcs.fnamemodify('.', ':p'):sub(-1)
+end
+
local M = {
prepend_argv = prepend_argv,
clear = clear,
@@ -635,6 +639,7 @@ local M = {
tmpname = tmpname,
meth_pcall = meth_pcall,
NIL = mpack.NIL,
+ get_pathsep = get_pathsep,
}
return function(after_each)