diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-11-25 19:15:05 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-11-25 19:27:38 +0000 |
commit | c5d770d311841ea5230426cc4c868e8db27300a8 (patch) | |
tree | dd21f70127b4b8b5f109baefc8ecc5016f507c91 /test/functional/vimscript/eval_spec.lua | |
parent | 9be89f131f87608f224f0ee06d199fcd09d32176 (diff) | |
parent | 081beb3659bd6d8efc3e977a160b1e72becbd8a2 (diff) | |
download | rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.tar.gz rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.tar.bz2 rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.zip |
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'test/functional/vimscript/eval_spec.lua')
-rw-r--r-- | test/functional/vimscript/eval_spec.lua | 92 |
1 files changed, 8 insertions, 84 deletions
diff --git a/test/functional/vimscript/eval_spec.lua b/test/functional/vimscript/eval_spec.lua index 0c812d968e..2a4835f7e1 100644 --- a/test/functional/vimscript/eval_spec.lua +++ b/test/functional/vimscript/eval_spec.lua @@ -25,8 +25,6 @@ local command = n.command local write_file = t.write_file local api = n.api local sleep = vim.uv.sleep -local matches = t.matches -local pcall_err = t.pcall_err local assert_alive = n.assert_alive local poke_eventloop = n.poke_eventloop local feed = n.feed @@ -189,12 +187,6 @@ describe('uncaught exception', function() it('multiline exception remains multiline #25350', function() local screen = Screen.new(80, 11) - screen:set_default_attr_ids({ - [1] = { bold = true, reverse = true }, -- MsgSeparator - [2] = { foreground = Screen.colors.White, background = Screen.colors.Red }, -- ErrorMsg - [3] = { bold = true, foreground = Screen.colors.SeaGreen }, -- MoreMsg - }) - screen:attach() exec_lua([[ function _G.Oops() error("oops") @@ -203,17 +195,17 @@ describe('uncaught exception', function() feed(':try\rlua _G.Oops()\rendtry\r') screen:expect { grid = [[ - {1: }| + {3: }| :try | : lua _G.Oops() | : endtry | - {2:Error detected while processing :} | - {2:E5108: Error executing lua [string "<nvim>"]:2: oops} | - {2:stack traceback:} | - {2: [C]: in function 'error'} | - {2: [string "<nvim>"]:2: in function 'Oops'} | - {2: [string ":lua"]:1: in main chunk} | - {3:Press ENTER or type command to continue}^ | + {9:Error detected while processing :} | + {9:E5108: Error executing lua [string "<nvim>"]:2: oops} | + {9:stack traceback:} | + {9: [C]: in function 'error'} | + {9: [string "<nvim>"]:2: in function 'Oops'} | + {9: [string ":lua"]:1: in main chunk} | + {6:Press ENTER or type command to continue}^ | ]], } end) @@ -233,74 +225,6 @@ describe('listing functions using :function', function() exec_capture(('function <lambda>%s'):format(num)) ) end) - - it('does not crash if another function is deleted while listing', function() - local screen = Screen.new(80, 24) - screen:attach() - matches( - 'Vim%(function%):E454: Function list was modified$', - pcall_err( - exec_lua, - [=[ - vim.cmd([[ - func Func1() - endfunc - func Func2() - endfunc - func Func3() - endfunc - ]]) - - local ns = vim.api.nvim_create_namespace('test') - - vim.ui_attach(ns, { ext_messages = true }, function(event, _, content) - if event == 'msg_show' and content[1][2] == 'function Func1()' then - vim.cmd('delfunc Func3') - end - end) - - vim.cmd('function') - - vim.ui_detach(ns) - ]=] - ) - ) - assert_alive() - end) - - it('does not crash if the same function is deleted while listing', function() - local screen = Screen.new(80, 24) - screen:attach() - matches( - 'Vim%(function%):E454: Function list was modified$', - pcall_err( - exec_lua, - [=[ - vim.cmd([[ - func Func1() - endfunc - func Func2() - endfunc - func Func3() - endfunc - ]]) - - local ns = vim.api.nvim_create_namespace('test') - - vim.ui_attach(ns, { ext_messages = true }, function(event, _, content) - if event == 'msg_show' and content[1][2] == 'function Func1()' then - vim.cmd('delfunc Func2') - end - end) - - vim.cmd('function') - - vim.ui_detach(ns) - ]=] - ) - ) - assert_alive() - end) end) it('no double-free in garbage collection #16287', function() |