From 99b1ba350d3c933322db541f86ee7a5f70995e30 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 8 Feb 2022 16:26:03 -0300 Subject: Fix crash when --lua-version is malformed --- spec/cmd_spec.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'spec') 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() end) describe("--lua-version", function() + it("fails if given something that is not a number", function() + local output = run.luarocks("--lua-version=bozo") + assert.match("malformed", output, 1, true) + end) + it("warns but continues if given an invalid version", function() local output = run.luarocks("--lua-version=1.0") assert.match("Warning: Lua 1.0 interpreter not found", output, 1, true) -- cgit v1.2.3-55-g6feb