aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2020-02-07 10:42:50 +0100
committerGitHub <noreply@github.com>2020-02-07 10:42:50 +0100
commit1a7f921e4cf1d4023340a8ba4dde17cb3e6bd311 (patch)
tree1c56d34fe38719bd41815c914c53294e5e4bb3e0 /spec
parent201ac63c7692355b07b83034c1813c000ec70e84 (diff)
downloadluarocks-1a7f921e4cf1d4023340a8ba4dde17cb3e6bd311.tar.gz
luarocks-1a7f921e4cf1d4023340a8ba4dde17cb3e6bd311.tar.bz2
luarocks-1a7f921e4cf1d4023340a8ba4dde17cb3e6bd311.zip
fix downgrades of rocks containing directories (#1151)
Fixes #1141
Diffstat (limited to 'spec')
-rw-r--r--spec/build_spec.lua8
-rw-r--r--spec/test_spec.lua18
2 files changed, 14 insertions, 12 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua
index 14837d89..e498509f 100644
--- a/spec/build_spec.lua
+++ b/spec/build_spec.lua
@@ -25,6 +25,8 @@ local extra_rocks = {
25 "/stdlib-41.0.0-1.src.rock", 25 "/stdlib-41.0.0-1.src.rock",
26 "/validate-args-1.5.4-1.rockspec", 26 "/validate-args-1.5.4-1.rockspec",
27 "spec/fixtures/a_rock-1.0-1.src.rock", 27 "spec/fixtures/a_rock-1.0-1.src.rock",
28 "/busted-2.0.0-1.rockspec",
29 "/busted-2.0.rc13-0.rockspec",
28} 30}
29 31
30local c_module_source = [[ 32local c_module_source = [[
@@ -290,6 +292,12 @@ describe("LuaRocks build #integration", function()
290 end) 292 end)
291 end 293 end
292 294
295 it("downgrades directories correctly", function()
296 assert(run.luarocks_bool("build --nodeps busted 2.0.0" ))
297 assert(run.luarocks_bool("build --nodeps busted 2.0.rc13" ))
298 assert(run.luarocks_bool("build --nodeps busted 2.0.0" ))
299 end)
300
293 it("only deps", function() 301 it("only deps", function()
294 local rockspec = testing_paths.fixtures_dir .. "/build_only_deps-0.1-1.rockspec" 302 local rockspec = testing_paths.fixtures_dir .. "/build_only_deps-0.1-1.rockspec"
295 303
diff --git a/spec/test_spec.lua b/spec/test_spec.lua
index ca1d5917..ddb64b0e 100644
--- a/spec/test_spec.lua
+++ b/spec/test_spec.lua
@@ -8,13 +8,13 @@ local write_file = test_env.write_file
8test_env.unload_luarocks() 8test_env.unload_luarocks()
9 9
10local extra_rocks = { 10local extra_rocks = {
11 "/busted-2.0.rc12-1.rockspec", 11 "/busted-2.0.0-1.rockspec",
12 "/lua_cliargs-3.0-1.src.rock", 12 "/lua_cliargs-3.0-1.src.rock",
13 "/luafilesystem-1.7.0-2.src.rock", 13 "/luafilesystem-1.7.0-2.src.rock",
14 "/luasystem-0.2.1-0.src.rock", 14 "/luasystem-0.2.1-0.src.rock",
15 "/dkjson-2.5-2.src.rock", 15 "/dkjson-2.5-2.src.rock",
16 "/say-1.3-1.rockspec", 16 "/say-1.3-1.rockspec",
17 "/luassert-1.7.10-0.rockspec", 17 "/luassert-1.8.0-0.rockspec",
18 "/lua-term-0.7-1.rockspec", 18 "/lua-term-0.7-1.rockspec",
19 "/penlight-1.5.4-1.rockspec", 19 "/penlight-1.5.4-1.rockspec",
20 "/mediator_lua-1.1.2-0.rockspec", 20 "/mediator_lua-1.1.2-0.rockspec",
@@ -40,16 +40,10 @@ describe("luarocks test #integration", function()
40 40
41 lazy_setup(function() 41 lazy_setup(function()
42 -- Try to cache rocks from the host system to speed up test 42 -- Try to cache rocks from the host system to speed up test
43 os.execute("luarocks pack busted") 43 for _, r in ipairs(extra_rocks) do
44 os.execute("luarocks pack lua_cliargs") 44 local n, v = r:match("^/(.*)%-([^%-]+)%-%d+%.[^%-]+$")
45 os.execute("luarocks pack luafilesystem") 45 os.execute("luarocks pack " .. n .. " " .. v)
46 os.execute("luarocks pack dkjson") 46 end
47 os.execute("luarocks pack luasystem")
48 os.execute("luarocks pack say")
49 os.execute("luarocks pack luassert")
50 os.execute("luarocks pack lua-term")
51 os.execute("luarocks pack penlight")
52 os.execute("luarocks pack mediator_lua")
53 if test_env.TEST_TARGET_OS == "windows" then 47 if test_env.TEST_TARGET_OS == "windows" then
54 os.execute("move *.rock " .. testing_paths.testing_server) 48 os.execute("move *.rock " .. testing_paths.testing_server)
55 else 49 else