From bb8df68c109bb860df57563d51003034a57bf7e1 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 19 Feb 2024 14:14:43 -0300 Subject: fix(config): print boolean values correctly on Lua 5.1 --- spec/config_spec.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'spec') diff --git a/spec/config_spec.lua b/spec/config_spec.lua index 05da0007..98fcb24c 100644 --- a/spec/config_spec.lua +++ b/spec/config_spec.lua @@ -238,6 +238,20 @@ describe("LuaRocks config tests #integration", function() end, finally) end) + it("writes a boolean config key", function() + test_env.run_in_tmp(function(tmpdir) + local myproject = tmpdir .. "/myproject" + lfs.mkdir(myproject) + lfs.chdir(myproject) + + assert(run.luarocks("init")) + assert.truthy(run.luarocks_bool("config hooks_enabled true")) + + local output = run.luarocks("config hooks_enabled") + assert.match("true", output) + end, finally) + end) + it("writes an array config key", function() test_env.run_in_tmp(function(tmpdir) local myproject = tmpdir .. "/myproject" -- cgit v1.2.3-55-g6feb