aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/new_version_spec.lua1
-rw-r--r--spec/pack_spec.lua5
-rw-r--r--test/testfiles/invalid_validate-args-1.5.4-1.rockspec35
3 files changed, 41 insertions, 0 deletions
diff --git a/spec/new_version_spec.lua b/spec/new_version_spec.lua
index 4e4d5d27..d77d32d1 100644
--- a/spec/new_version_spec.lua
+++ b/spec/new_version_spec.lua
@@ -30,6 +30,7 @@ describe("LuaRocks new_version tests #blackbox #b_new_version", function()
30 it("LuaRocks new version invalid url", function() 30 it("LuaRocks new version invalid url", function()
31 assert.is_true(run.luarocks_bool("download --rockspec abelhas 1.0")) 31 assert.is_true(run.luarocks_bool("download --rockspec abelhas 1.0"))
32 assert.is_true(run.luarocks_bool("new_version abelhas-1.0-1.rockspec 1.1 http://luainvalid")) 32 assert.is_true(run.luarocks_bool("new_version abelhas-1.0-1.rockspec 1.1 http://luainvalid"))
33 assert.is.truthy(lfs.attributes("abelhas-1.1-1.rockspec"))
33 test_env.remove_files(lfs.currentdir(), "abelhas--") 34 test_env.remove_files(lfs.currentdir(), "abelhas--")
34 end) 35 end)
35 end) 36 end)
diff --git a/spec/pack_spec.lua b/spec/pack_spec.lua
index 416184a8..aa827682 100644
--- a/spec/pack_spec.lua
+++ b/spec/pack_spec.lua
@@ -1,6 +1,7 @@
1local test_env = require("test/test_environment") 1local test_env = require("test/test_environment")
2local lfs = require("lfs") 2local lfs = require("lfs")
3local run = test_env.run 3local run = test_env.run
4local testing_paths = test_env.testing_paths
4 5
5test_env.unload_luarocks() 6test_env.unload_luarocks()
6 7
@@ -21,6 +22,10 @@ describe("LuaRocks pack tests #blackbox #b_pack", function()
21 assert.is_true(run.luarocks_bool("pack luacov")) 22 assert.is_true(run.luarocks_bool("pack luacov"))
22 assert.is_true(test_env.remove_files(lfs.currentdir(), "luacov-")) 23 assert.is_true(test_env.remove_files(lfs.currentdir(), "luacov-"))
23 end) 24 end)
25
26 it("LuaRocks pack invalid rockspec", function()
27 assert.is_false(run.luarocks_bool("pack " .. testing_paths.testing_dir .. "/testfiles/invaild_validate-args-1.5.4-1.rockspec"))
28 end)
24 29
25 it("LuaRocks pack src", function() 30 it("LuaRocks pack src", function()
26 assert.is_true(run.luarocks_bool("install luasec")) 31 assert.is_true(run.luarocks_bool("install luasec"))
diff --git a/test/testfiles/invalid_validate-args-1.5.4-1.rockspec b/test/testfiles/invalid_validate-args-1.5.4-1.rockspec
new file mode 100644
index 00000000..0b4d807d
--- /dev/null
+++ b/test/testfiles/invalid_validate-args-1.5.4-1.rockspec
@@ -0,0 +1,35 @@
1package = 'validate-args'
2version = '1.5.4-1'
3source = {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{++{
4 url = "https://bitbucket.org/djerius/validate.args/downloads/validate-args-1.5.4.tar.gz"
5}
6
7description = {
8 summary = "Function argument validation",
9 detailed = [[
10 validate.args is a Lua module that provides a framework for
11 validation of arguments to Lua functions as well as complex data
12 structures. The included validate.inplace module provides "live"
13 validation during assignment of values to elements in tables. ]],
14 license = "GPL-3",
15
16}
17
18dependencies = {
19 "lua >= 5.1"
20}
21
22build = {
23
24 type = "builtin",
25
26 modules = {
27 ["validate.args"] = "validate/args.lua",
28 ["validate.inplace"] = "validate/inplace.lua",
29 },
30
31 copy_directories = {
32 "doc", "tests"
33 }
34
35}