diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2022-04-16 18:53:07 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2022-04-16 21:17:34 -0300 |
| commit | 0f82063a51cd9197edd214e0427fe4e84ae9c0b9 (patch) | |
| tree | 90b1f09e2504e8eb97209af4ec24e7ab6fdfbb17 /spec/unpack_spec.lua | |
| parent | a405d1a5f6c9eb7249a9271ca23ff1f701f91cfe (diff) | |
| download | luarocks-0f82063a51cd9197edd214e0427fe4e84ae9c0b9.tar.gz luarocks-0f82063a51cd9197edd214e0427fe4e84ae9c0b9.tar.bz2 luarocks-0f82063a51cd9197edd214e0427fe4e84ae9c0b9.zip | |
tests: run tests on Lua 5.4 and LuaJIT 2.1
Diffstat (limited to 'spec/unpack_spec.lua')
| -rw-r--r-- | spec/unpack_spec.lua | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/spec/unpack_spec.lua b/spec/unpack_spec.lua index 9b1e2b9a..00d6781f 100644 --- a/spec/unpack_spec.lua +++ b/spec/unpack_spec.lua | |||
| @@ -1,12 +1,13 @@ | |||
| 1 | local test_env = require("spec.util.test_env") | 1 | local test_env = require("spec.util.test_env") |
| 2 | local lfs = require("lfs") | ||
| 2 | local run = test_env.run | 3 | local run = test_env.run |
| 3 | local testing_paths = test_env.testing_paths | 4 | local testing_paths = test_env.testing_paths |
| 4 | 5 | ||
| 5 | test_env.unload_luarocks() | 6 | test_env.unload_luarocks() |
| 6 | 7 | ||
| 7 | local extra_rocks = { | 8 | local extra_rocks = { |
| 8 | "/cprint-0.1-2.src.rock", | 9 | "/cprint-${CPRINT}.src.rock", |
| 9 | "/cprint-0.1-2.rockspec", | 10 | "/cprint-${CPRINT}.rockspec", |
| 10 | "/luazip-1.2.4-1.rockspec" | 11 | "/luazip-1.2.4-1.rockspec" |
| 11 | } | 12 | } |
| 12 | 13 | ||
| @@ -33,22 +34,22 @@ describe("luarocks unpack #integration", function() | |||
| 33 | describe("more complex tests", function() | 34 | describe("more complex tests", function() |
| 34 | it("download", function() | 35 | it("download", function() |
| 35 | assert.is_true(run.luarocks_bool("unpack cprint")) | 36 | assert.is_true(run.luarocks_bool("unpack cprint")) |
| 36 | test_env.remove_dir("cprint-0.1-2") | 37 | test_env.remove_dir("cprint-${CPRINT}") |
| 37 | end) | 38 | end) |
| 38 | 39 | ||
| 39 | it("src", function() | 40 | it("src", function() |
| 40 | assert.is_true(run.luarocks_bool("download --source cprint")) | 41 | assert.is_true(run.luarocks_bool("download --source cprint")) |
| 41 | assert.is_true(run.luarocks_bool("unpack cprint-0.1-2.src.rock")) | 42 | assert.is_true(run.luarocks_bool("unpack cprint-${CPRINT}.src.rock")) |
| 42 | os.remove("cprint-0.1-2.src.rock") | 43 | os.remove("cprint-${CPRINT}.src.rock") |
| 43 | test_env.remove_dir("cprint-0.1-2") | 44 | test_env.remove_dir("cprint-${CPRINT}") |
| 44 | end) | 45 | end) |
| 45 | 46 | ||
| 46 | it("src", function() | 47 | it("src", function() |
| 47 | assert.is_true(run.luarocks_bool("download --rockspec cprint")) | 48 | assert.is_true(run.luarocks_bool("download --rockspec cprint")) |
| 48 | assert.is_true(run.luarocks_bool("unpack cprint-0.1-2.rockspec")) | 49 | assert.is_true(run.luarocks_bool("unpack cprint-${CPRINT}.rockspec")) |
| 49 | os.remove("cprint-0.1-2.rockspec") | 50 | os.remove("cprint-${CPRINT}.rockspec") |
| 50 | os.remove("lua-cprint") | 51 | os.remove("lua-cprint") |
| 51 | test_env.remove_dir("cprint-0.1-2") | 52 | test_env.remove_dir("cprint-${CPRINT}") |
| 52 | end) | 53 | end) |
| 53 | 54 | ||
| 54 | -- #595 luarocks unpack of a git:// rockspec fails to copy the rockspec | 55 | -- #595 luarocks unpack of a git:// rockspec fails to copy the rockspec |
| @@ -62,9 +63,9 @@ describe("luarocks unpack #integration", function() | |||
| 62 | it("binary", function() | 63 | it("binary", function() |
| 63 | assert.is_true(run.luarocks_bool("build cprint")) | 64 | assert.is_true(run.luarocks_bool("build cprint")) |
| 64 | assert.is_true(run.luarocks_bool("pack cprint")) | 65 | assert.is_true(run.luarocks_bool("pack cprint")) |
| 65 | assert.is_true(run.luarocks_bool("unpack cprint-0.1-2." .. test_env.platform .. ".rock")) | 66 | assert.is_true(run.luarocks_bool("unpack cprint-${CPRINT}." .. test_env.platform .. ".rock")) |
| 66 | test_env.remove_dir("cprint-0.1-2") | 67 | test_env.remove_dir("cprint-${CPRINT}") |
| 67 | os.remove("cprint-0.1-2." .. test_env.platform .. ".rock") | 68 | os.remove("cprint-${CPRINT}." .. test_env.platform .. ".rock") |
| 68 | end) | 69 | end) |
| 69 | end) | 70 | end) |
| 70 | end) | 71 | end) |
