aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2022-02-08 16:26:03 -0300
committerHisham Muhammad <hisham@gobolinux.org>2022-02-08 16:26:03 -0300
commit99b1ba350d3c933322db541f86ee7a5f70995e30 (patch)
tree2926e1a71ee7522215f7e876dd8495035fc8b31e /spec
parentf226ebefb536a8fea5e93863cff0afcdad005ce9 (diff)
downloadluarocks-99b1ba350d3c933322db541f86ee7a5f70995e30.tar.gz
luarocks-99b1ba350d3c933322db541f86ee7a5f70995e30.tar.bz2
luarocks-99b1ba350d3c933322db541f86ee7a5f70995e30.zip
Fix crash when --lua-version is malformed
Diffstat (limited to 'spec')
-rw-r--r--spec/cmd_spec.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/cmd_spec.lua b/spec/cmd_spec.lua
index d28acdf6..fe27ab1b 100644
--- a/spec/cmd_spec.lua
+++ b/spec/cmd_spec.lua
@@ -53,6 +53,11 @@ describe("LuaRocks command line #integration", function()
53 end) 53 end)
54 54
55 describe("--lua-version", function() 55 describe("--lua-version", function()
56 it("fails if given something that is not a number", function()
57 local output = run.luarocks("--lua-version=bozo")
58 assert.match("malformed", output, 1, true)
59 end)
60
56 it("warns but continues if given an invalid version", function() 61 it("warns but continues if given an invalid version", function()
57 local output = run.luarocks("--lua-version=1.0") 62 local output = run.luarocks("--lua-version=1.0")
58 assert.match("Warning: Lua 1.0 interpreter not found", output, 1, true) 63 assert.match("Warning: Lua 1.0 interpreter not found", output, 1, true)