diff options
Diffstat (limited to 'spec/util/test_env.lua')
-rw-r--r-- | spec/util/test_env.lua | 10 |
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)) |
119 | end | 119 | end |
120 | 120 | ||
121 | -- Monkeypatch incorrect tmpname's on some Lua distributions for Windows | ||
122 | local os_tmpname = os.tmpname | ||
123 | os.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 | ||
129 | end | ||
130 | |||
121 | local lfs_chdir = lfs.chdir | 131 | local lfs_chdir = lfs.chdir |
122 | lfs.chdir = function(d) -- luacheck: ignore | 132 | lfs.chdir = function(d) -- luacheck: ignore |
123 | return lfs_chdir(V(d)) | 133 | return lfs_chdir(V(d)) |