aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-06-27 02:29:15 +0200
committerGitHub <noreply@github.com>2017-06-27 02:29:15 +0200
commitf34befe74c5a7b18a802f6f3c79607cb2124004c (patch)
tree955fc4456e7710213f7339e95cd40464088c08ec /test/functional/helpers.lua
parent1ef2d768e71981e4429376a0cb25dbed14dfae52 (diff)
parentcab3a248b2704e8f188eaf20206f2c87d1a76c0d (diff)
downloadrneovim-f34befe74c5a7b18a802f6f3c79607cb2124004c.tar.gz
rneovim-f34befe74c5a7b18a802f6f3c79607cb2124004c.tar.bz2
rneovim-f34befe74c5a7b18a802f6f3c79607cb2124004c.zip
Merge #6789 from ZyX-I/lua-path
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 5b641b5054..4a170d993b 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -581,6 +581,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,
@@ -649,6 +667,7 @@ local module = {
NIL = mpack.NIL,
get_pathsep = get_pathsep,
missing_provider = missing_provider,
+ alter_slashes = alter_slashes,
}
return function(after_each)