diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-10-22 16:10:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-22 08:10:15 +0000 |
commit | 8c532a9ea8a0bb2ee93d772c9589d1a84afeb541 (patch) | |
tree | 0bd0d98de03fbf72426b64b81d59aaa7c667a1ce /test/functional/ui/highlight_spec.lua | |
parent | 772614f9cc44bfd4914d27698509077e762873c0 (diff) | |
download | rneovim-8c532a9ea8a0bb2ee93d772c9589d1a84afeb541.tar.gz rneovim-8c532a9ea8a0bb2ee93d772c9589d1a84afeb541.tar.bz2 rneovim-8c532a9ea8a0bb2ee93d772c9589d1a84afeb541.zip |
fix(options): fix 'winhl' still accepting invalid value (#30896)
Diffstat (limited to 'test/functional/ui/highlight_spec.lua')
-rw-r--r-- | test/functional/ui/highlight_spec.lua | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua index 47b923c8e2..c989418409 100644 --- a/test/functional/ui/highlight_spec.lua +++ b/test/functional/ui/highlight_spec.lua @@ -2426,16 +2426,24 @@ describe('highlight namespaces', function() end) it('winhl does not accept invalid value #24586', function() - local res = exec_lua([[ - local curwin = vim.api.nvim_get_current_win() - vim.api.nvim_command("set winhl=Normal:Visual") - local _, msg = pcall(vim.api.nvim_command,"set winhl='Normal:Wrong'") - return { msg, vim.wo[curwin].winhl } - ]]) - eq({ - 'Vim(set):E5248: Invalid character in group name', - 'Normal:Visual', - }, res) + command('set winhl=Normal:Visual') + for _, cmd in ipairs({ + [[set winhl='Normal:Wrong']], + [[set winhl=Normal:Wrong']], + [[set winhl='Normal:Wrong]], + }) do + local res = exec_lua( + [[ + local _, msg = pcall(vim.api.nvim_command, ...) + return { msg, vim.wo.winhl } + ]], + cmd + ) + eq({ + 'Vim(set):E5248: Invalid character in group name', + 'Normal:Visual', + }, res) + end end) it('Normal in set_hl #25474', function() |