aboutsummaryrefslogtreecommitdiff
path: root/spec/util/test_env.lua
diff options
context:
space:
mode:
authorSewbacca <sewbacca@kolabnow.com>2024-03-04 12:57:12 -0300
committerHisham Muhammad <hisham@gobolinux.org>2024-03-04 21:52:09 +0000
commit1f3e8794254d32d44c510e3868378b2f969b0ba6 (patch)
tree2e0826d5f4694223f4fe7f81e537b280749b33a0 /spec/util/test_env.lua
parent531393e338746830aa6138c2f671ffc4e4db9e28 (diff)
downloadluarocks-1f3e8794254d32d44c510e3868378b2f969b0ba6.tar.gz
luarocks-1f3e8794254d32d44c510e3868378b2f969b0ba6.tar.bz2
luarocks-1f3e8794254d32d44c510e3868378b2f969b0ba6.zip
tests: add tests for fs.execute_env using variables with spaces
Co-Authored-By: Hisham Muhammad <hisham@gobolinux.org>
Diffstat (limited to '')
-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))