aboutsummaryrefslogtreecommitdiff
path: root/spec/quick
diff options
context:
space:
mode:
authorBruno Thiago <45828157+brunotvs@users.noreply.github.com>2026-03-17 14:33:03 -0300
committerGitHub <noreply@github.com>2026-03-17 14:33:03 -0300
commit6b0a7f7f8770f5d21730a5f2fa8fcbc695687c43 (patch)
tree8fa3c8c6a2d52fc84c2b96762457dab3412e37d7 /spec/quick
parentdf425b4a24637797f552245685d7535ad9a56f7c (diff)
downloadluarocks-6b0a7f7f8770f5d21730a5f2fa8fcbc695687c43.tar.gz
luarocks-6b0a7f7f8770f5d21730a5f2fa8fcbc695687c43.tar.bz2
luarocks-6b0a7f7f8770f5d21730a5f2fa8fcbc695687c43.zip
fix: check if table entry is nil or not (#1867)
running ```luarocks config local_by_default``` returns ```Error: Unknown entry local_by_default``` and running ```luarocks config local_by_default true``` writes it as a string to the config file: ```lua local_by_default = "true" ``` Same is true to any bool var set as false. This pr aims to fix this issue.
Diffstat (limited to 'spec/quick')
-rw-r--r--spec/quick/config.q38
1 files changed, 38 insertions, 0 deletions
diff --git a/spec/quick/config.q b/spec/quick/config.q
index d6230567..dd2dcd00 100644
--- a/spec/quick/config.q
+++ b/spec/quick/config.q
@@ -95,3 +95,41 @@ Warning: Failed finding Lua header lua.h (searched at /some/bad/path). You may n
95 95
96LuaRocks may not work correctly when building C modules using this configuration. 96LuaRocks may not work correctly when building C modules using this configuration.
97-------------------------------------------------------------------------------- 97--------------------------------------------------------------------------------
98
99
100
101================================================================================
102TEST: reports when getting a falsy boolean variable
103
104RUN: luarocks config local_by_default
105
106STDOUT:
107--------------------------------------------------------------------------------
108false
109--------------------------------------------------------------------------------
110
111
112
113================================================================================
114TEST: reports when setting a falsy boolean variable
115
116RUN: luarocks config local_by_default true
117
118STDOUT:
119--------------------------------------------------------------------------------
120Wrote
121local_by_default = true
122--------------------------------------------------------------------------------
123
124
125
126================================================================================
127TEST: reports when getting an unknown variable
128
129RUN: luarocks config foo
130EXIT: 1
131
132STDERR:
133--------------------------------------------------------------------------------
134Error: Unknown entry foo
135--------------------------------------------------------------------------------