diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-05-03 19:26:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-03 19:26:56 +0800 |
commit | e15991c8116cc7fa1c0ccf65b544199ec6ffa7e8 (patch) | |
tree | ace0ce1475826ca2ec9a73572708189ee1b43ed7 /test/functional/lua/json_spec.lua | |
parent | 40ce8577977fcdce8ad76863c70eb522e4cefd4d (diff) | |
download | rneovim-e15991c8116cc7fa1c0ccf65b544199ec6ffa7e8.tar.gz rneovim-e15991c8116cc7fa1c0ccf65b544199ec6ffa7e8.tar.bz2 rneovim-e15991c8116cc7fa1c0ccf65b544199ec6ffa7e8.zip |
fix(vim.json): properly treat luanil options as booleans (#28622)
Note: Upstream doesn't have this. It's an Nvim addition.
Diffstat (limited to 'test/functional/lua/json_spec.lua')
-rw-r--r-- | test/functional/lua/json_spec.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/lua/json_spec.lua b/test/functional/lua/json_spec.lua index 78e1896a20..a6e814d739 100644 --- a/test/functional/lua/json_spec.lua +++ b/test/functional/lua/json_spec.lua @@ -32,6 +32,18 @@ describe('vim.json.decode()', function() baz = vim.NIL, foo = { a = 'b' }, }, exec_lua([[return vim.json.decode(..., {})]], jsonstr)) + eq( + { + arr = { 1, 2, vim.NIL }, + bar = { 3, 7 }, + baz = vim.NIL, + foo = { a = 'b' }, + }, + exec_lua( + [[return vim.json.decode(..., { luanil = { array = false, object = false } })]], + jsonstr + ) + ) eq({ arr = { 1, 2, vim.NIL }, bar = { 3, 7 }, |