aboutsummaryrefslogtreecommitdiff
path: root/spec/util/test_env.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/util/test_env.lua')
-rw-r--r--spec/util/test_env.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua
index be75b4ec..2255d141 100644
--- a/spec/util/test_env.lua
+++ b/spec/util/test_env.lua
@@ -118,6 +118,16 @@ os.rename = function(a, b) -- luacheck: ignore
118 return os_rename(V(a), V(b)) 118 return os_rename(V(a), V(b))
119end 119end
120 120
121-- Monkeypatch incorrect tmpname's on some Lua distributions for Windows
122local os_tmpname = os.tmpname
123os.tmpname = function() -- luacheck:ignore
124 local name = os_tmpname()
125 if name:sub(1, 1) == '\\' then
126 name = os.getenv "TEMP"..name
127 end
128 return name
129end
130
121local lfs_chdir = lfs.chdir 131local lfs_chdir = lfs.chdir
122lfs.chdir = function(d) -- luacheck: ignore 132lfs.chdir = function(d) -- luacheck: ignore
123 return lfs_chdir(V(d)) 133 return lfs_chdir(V(d))