neovim/test/functional/lua
Emanuel e057b38e70
fix(json): allow objects with empty keys #25564
Problem:
Empty string is a valid JSON key, but json_decode() treats an object
with empty key as ":help msgpack-special-dict". #20757

    :echo json_decode('{"": "1"}')
    {'_TYPE': [], '_VAL': [['', '1']]}

Note: vim returns `{'': '1'}`.

Solution:
Allow empty string as an object key.

Note that we still (currently) disallow empty keys in object_to_vim() (since 7c01d5ff92):
f64e4b43e1/src/nvim/api/private/converter.c (L333-L334)

Fix #20757

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2023-12-06 07:56:04 -08:00
..
api_spec.lua fix(api): revert unintended change of optional bool params 2023-08-09 20:34:07 +02:00
base64_spec.lua feat(stdlib): add vim.base64 module (#25843) 2023-10-31 09:15:32 -05:00
buffer_updates_spec.lua fix(change): update fold after on_bytes (#26364) 2023-12-05 08:40:48 +08:00
command_line_completion_spec.lua refactor(options): deprecate nvim[_buf|_win]_[gs]et_option 2023-05-21 15:14:01 +06:00
commands_spec.lua fix(excmd): append original command to error message 2023-05-05 10:43:28 +08:00
diagnostic_spec.lua fix(diagnostic): virtual_text prefix function should have index and total (#25801) 2023-10-27 08:17:46 -05:00
ffi_spec.lua refactor: remove char_u (#22829) 2023-04-02 16:11:42 +08:00
filetype_spec.lua test: don't unnecessarily specify win/buf for nvim_(get|set)_option_value 2023-05-22 13:02:07 +06:00
fs_spec.lua test(windows): unskip working tests (#25153) 2023-09-15 16:33:26 +08:00
help_spec.lua ci(cirrus): don't run lua/help_spec (#25498) 2023-10-21 07:21:19 +08:00
highlight_spec.lua feat(lua): rename vim.loop -> vim.uv (#22846) 2023-06-03 12:06:00 +02:00
inspector_spec.lua refactor(options): deprecate nvim[_buf|_win]_[gs]et_option 2023-05-21 15:14:01 +06:00
iter_spec.lua feat(lua): implement Iter:join() (#26416) 2023-12-05 18:35:22 -08:00
json_spec.lua fix(json): allow objects with empty keys #25564 2023-12-06 07:56:04 -08:00
loader_spec.lua fix(loader): cache path ambiguity #24491 2023-08-01 08:28:28 -07:00
loop_spec.lua feat(lua): rename vim.loop -> vim.uv (#22846) 2023-06-03 12:06:00 +02:00
luaeval_spec.lua test: don't unnecessarily specify win/buf for nvim_(get|set)_option_value 2023-05-22 13:02:07 +06:00
mpack_spec.lua fix(vim.mpack): rename pack/unpack => encode/decode #16175 2021-10-30 06:59:59 -07:00
overrides_spec.lua feat(treesitter): improve query error message 2023-08-31 13:33:40 +01:00
runtime_spec.lua fix(runtime): respect 'fileignorecase' when sourcing (#24344) 2023-07-14 07:57:13 +08:00
secure_spec.lua test: don't unnecessarily specify win/buf for nvim_(get|set)_option_value 2023-05-22 13:02:07 +06:00
snippet_spec.lua refactor(snippet): rename test utilities 2023-11-17 17:10:27 +01:00
spell_spec.lua feat(test): add Lua forms for API methods (#20152) 2022-11-14 10:01:35 +00:00
system_spec.lua refactor(vim.system): factor out on_exit handling 2023-09-05 17:10:04 +01:00
text_spec.lua feat: add vim.text module (#26069) 2023-11-16 11:35:54 -06:00
thread_spec.lua feat(lua): rename vim.loop -> vim.uv (#22846) 2023-06-03 12:06:00 +02:00
ui_event_spec.lua vim-patch:8.1.0822: peeking and flushing output slows down execution (#25629) 2023-10-14 09:58:30 +08:00
ui_spec.lua test(vim.ui.open): mock failure on Windows 2023-07-21 14:38:17 +02:00
uri_spec.lua test: simplify platform detection (#21020) 2022-11-22 08:13:30 +08:00
version_spec.lua feat: tostring(vim.version()) 2023-06-12 01:14:33 +02:00
vim_spec.lua test: check vim.wait() error message in fast context (#26242) 2023-11-27 18:24:32 +08:00
watch_spec.lua test: skip failing watch file tests on freebsd (#26110) 2023-11-19 18:37:49 +01:00
xdiff_spec.lua feat(test): add Lua forms for API methods (#20152) 2022-11-14 10:01:35 +00:00