aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/vim_spec.lua
diff options
context:
space:
mode:
authorRZia <36330543+grassdne@users.noreply.github.com>2022-10-09 20:04:08 -0400
committerGitHub <noreply@github.com>2022-10-10 08:04:08 +0800
commita5597d1fc066a8512ce9434dbff70850dc7bd5a1 (patch)
treec3f1f1cf174c8b67e4be41ee8a781734fadcc4ec /test/functional/lua/vim_spec.lua
parent9d0ed754d5a8e6b442e1da2a153422dcee9004e1 (diff)
downloadrneovim-a5597d1fc066a8512ce9434dbff70850dc7bd5a1.tar.gz
rneovim-a5597d1fc066a8512ce9434dbff70850dc7bd5a1.tar.bz2
rneovim-a5597d1fc066a8512ce9434dbff70850dc7bd5a1.zip
fix(lua): assert failure with vim.regex() error inside :silent! (#20555)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Diffstat (limited to 'test/functional/lua/vim_spec.lua')
-rw-r--r--test/functional/lua/vim_spec.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua
index 6451453ce0..47a0004183 100644
--- a/test/functional/lua/vim_spec.lua
+++ b/test/functional/lua/vim_spec.lua
@@ -24,6 +24,7 @@ local rmdir = helpers.rmdir
local write_file = helpers.write_file
local expect_exit = helpers.expect_exit
local poke_eventloop = helpers.poke_eventloop
+local assert_alive = helpers.assert_alive
describe('lua stdlib', function()
before_each(clear)
@@ -2210,6 +2211,10 @@ describe('lua stdlib', function()
eq({3,7}, exec_lua[[return {re1:match_line(0, 1, 1, 8)}]])
eq({}, exec_lua[[return {re1:match_line(0, 1, 1, 7)}]])
eq({0,3}, exec_lua[[return {re1:match_line(0, 1, 0, 7)}]])
+
+ -- vim.regex() error inside :silent! should not crash. #20546
+ command([[silent! lua vim.regex('\\z')]])
+ assert_alive()
end)
it('vim.defer_fn', function()