aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2024-03-05 21:38:15 -0300
committerHisham Muhammad <hisham@gobolinux.org>2024-03-06 15:14:36 +0000
commitf50f9d58ef5fe86363e5223b2b55075f6c4c636c (patch)
treea5a0905f1907405ea508922f2cf9f17b7276350e /spec
parent8d30fc5bd2b352897b81756400ab50d2be859209 (diff)
downloadluarocks-f50f9d58ef5fe86363e5223b2b55075f6c4c636c.tar.gz
luarocks-f50f9d58ef5fe86363e5223b2b55075f6c4c636c.tar.bz2
luarocks-f50f9d58ef5fe86363e5223b2b55075f6c4c636c.zip
fix(windows): parse slashes correctly when reading rock_manifest
Diffstat (limited to 'spec')
-rw-r--r--spec/quick/build.q47
-rw-r--r--spec/util/test_env.lua2
2 files changed, 48 insertions, 1 deletions
diff --git a/spec/quick/build.q b/spec/quick/build.q
index 958ce5d1..6d7c4744 100644
--- a/spec/quick/build.q
+++ b/spec/quick/build.q
@@ -302,3 +302,50 @@ return {
302 } 302 }
303} 303}
304-------------------------------------------------------------------------------- 304--------------------------------------------------------------------------------
305
306
307
308================================================================================
309TEST: installs bin entries correctly
310
311FILE: test-1.0-1.rockspec
312--------------------------------------------------------------------------------
313package = "test"
314version = "1.0-1"
315source = {
316 url = "file://%{url(%{fixtures_dir})}/an_upstream_tarball-0.1.tar.gz",
317 dir = "an_upstream_tarball-0.1",
318}
319build = {
320 type = "builtin",
321 modules = {
322 my_module = "src/my_module.lua"
323 },
324 install = {
325 bin = {
326 "src/my_module.lua"
327 }
328 }
329}
330--------------------------------------------------------------------------------
331
332RUN: luarocks build test-1.0-1.rockspec --tree=lua_modules
333
334RM: %{fixtures_dir}/bin/something.lua
335
336EXISTS: ./lua_modules/lib/luarocks/rocks-%{lua_version}/test/1.0-1/test-1.0-1.rockspec
337
338FILE_CONTENTS: ./lua_modules/lib/luarocks/rocks-%{lua_version}/test/1.0-1/rock_manifest
339--------------------------------------------------------------------------------
340rock_manifest = {
341 bin = {
342 ["my_module.lua"] = "25884dbf5be7114791018a48199d4c04"
343 },
344 lua = {
345 ["my_module.lua"] = "25884dbf5be7114791018a48199d4c04"
346 },
347 ["test-1.0-1.rockspec"] =
348}
349--------------------------------------------------------------------------------
350
351EXISTS: ./lua_modules/bin/my_module.lua%{wrapper_extension}
diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua
index 2255d141..5d385db3 100644
--- a/spec/util/test_env.lua
+++ b/spec/util/test_env.lua
@@ -527,7 +527,7 @@ end
527function test_env.write_file(pathname, str, finally) 527function test_env.write_file(pathname, str, finally)
528 pathname = V(pathname) 528 pathname = V(pathname)
529 529
530 local file = assert(io.open(pathname, "w")) 530 local file = assert(io.open(pathname, "wb"))
531 file:write(str) 531 file:write(str)
532 file:close() 532 file:close()
533 if finally then 533 if finally then