aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-05-23 00:46:57 +0300
committerZyX <kp-pav@yandex.ru>2017-05-25 16:27:40 +0300
commit97602371e6b00f280ede5e3f6b0e0c1144f46c72 (patch)
tree669833472c79750f8a590b766f0890b344a1f611 /test/functional/helpers.lua
parenta5a5c83608e6d4455ac40e8786fd16eaf817c608 (diff)
downloadrneovim-97602371e6b00f280ede5e3f6b0e0c1144f46c72.tar.gz
rneovim-97602371e6b00f280ede5e3f6b0e0c1144f46c72.tar.bz2
rneovim-97602371e6b00f280ede5e3f6b0e0c1144f46c72.zip
lua: Add paths from &runtimepath to package.path and package.cpath
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r--test/functional/helpers.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index b03840b3fe..4bd9ae4bfb 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -579,6 +579,24 @@ local function missing_provider(provider)
end
end
+local function alter_slashes(obj)
+ if not iswin() then
+ return obj
+ end
+ if type(obj) == 'string' then
+ local ret = obj:gsub('/', '\\')
+ return ret
+ elseif type(obj) == 'table' then
+ local ret = {}
+ for k, v in pairs(obj) do
+ ret[k] = alter_slashes(v)
+ end
+ return ret
+ else
+ assert(false, 'Could only alter slashes for tables of strings and strings')
+ end
+end
+
local module = {
prepend_argv = prepend_argv,
clear = clear,
@@ -646,6 +664,7 @@ local module = {
NIL = mpack.NIL,
get_pathsep = get_pathsep,
missing_provider = missing_provider,
+ alter_slashes = alter_slashes,
}
return function(after_each)