diff options
| author | Bruno Thiago <45828157+brunotvs@users.noreply.github.com> | 2026-03-17 14:33:03 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-17 14:33:03 -0300 |
| commit | 6b0a7f7f8770f5d21730a5f2fa8fcbc695687c43 (patch) | |
| tree | 8fa3c8c6a2d52fc84c2b96762457dab3412e37d7 /spec/quick | |
| parent | df425b4a24637797f552245685d7535ad9a56f7c (diff) | |
| download | luarocks-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.q | 38 |
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 | ||
| 96 | LuaRocks may not work correctly when building C modules using this configuration. | 96 | LuaRocks may not work correctly when building C modules using this configuration. |
| 97 | -------------------------------------------------------------------------------- | 97 | -------------------------------------------------------------------------------- |
| 98 | |||
| 99 | |||
| 100 | |||
| 101 | ================================================================================ | ||
| 102 | TEST: reports when getting a falsy boolean variable | ||
| 103 | |||
| 104 | RUN: luarocks config local_by_default | ||
| 105 | |||
| 106 | STDOUT: | ||
| 107 | -------------------------------------------------------------------------------- | ||
| 108 | false | ||
| 109 | -------------------------------------------------------------------------------- | ||
| 110 | |||
| 111 | |||
| 112 | |||
| 113 | ================================================================================ | ||
| 114 | TEST: reports when setting a falsy boolean variable | ||
| 115 | |||
| 116 | RUN: luarocks config local_by_default true | ||
| 117 | |||
| 118 | STDOUT: | ||
| 119 | -------------------------------------------------------------------------------- | ||
| 120 | Wrote | ||
| 121 | local_by_default = true | ||
| 122 | -------------------------------------------------------------------------------- | ||
| 123 | |||
| 124 | |||
| 125 | |||
| 126 | ================================================================================ | ||
| 127 | TEST: reports when getting an unknown variable | ||
| 128 | |||
| 129 | RUN: luarocks config foo | ||
| 130 | EXIT: 1 | ||
| 131 | |||
| 132 | STDERR: | ||
| 133 | -------------------------------------------------------------------------------- | ||
| 134 | Error: Unknown entry foo | ||
| 135 | -------------------------------------------------------------------------------- | ||
