diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-09-02 23:02:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-02 23:02:58 +0200 |
commit | 6434a0bf99d1733a295844813db201d533e65883 (patch) | |
tree | bc8c87d377cc19ab5ac24e01215409b1d5e8cf23 /test/functional/lua/utility_functions_spec.lua | |
parent | d3c17d50d828d7c983f58fc37590126091316930 (diff) | |
parent | 7e07efaff429d8d8634fd059c6295c7ff0b56c6c (diff) | |
download | rneovim-6434a0bf99d1733a295844813db201d533e65883.tar.gz rneovim-6434a0bf99d1733a295844813db201d533e65883.tar.bz2 rneovim-6434a0bf99d1733a295844813db201d533e65883.zip |
Merge pull request #10920 from bfredl/asyncfail
api: make try_end clean-up after an exception properly.
Diffstat (limited to 'test/functional/lua/utility_functions_spec.lua')
-rw-r--r-- | test/functional/lua/utility_functions_spec.lua | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/functional/lua/utility_functions_spec.lua b/test/functional/lua/utility_functions_spec.lua index 0d93914119..ff15ebf8b3 100644 --- a/test/functional/lua/utility_functions_spec.lua +++ b/test/functional/lua/utility_functions_spec.lua @@ -1,5 +1,6 @@ -- Test suite for testing interactions with API bindings local helpers = require('test.functional.helpers')(after_each) +local Screen = require('test.functional.ui.screen') local funcs = helpers.funcs local clear = helpers.clear @@ -160,6 +161,37 @@ describe('lua function', function() feed("<cr>") eq('Error executing vim.schedule lua callback: [string "<nvim>"]:2: big failure\nvery async', eval("v:errmsg")) + + local screen = Screen.new(60,5) + screen:set_default_attr_ids({ + [1] = {bold = true, foreground = Screen.colors.Blue1}, + [2] = {bold = true, reverse = true}, + [3] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red}, + [4] = {bold = true, foreground = Screen.colors.SeaGreen4}, + }) + screen:attach() + screen:expect{grid=[[ + ^ | + {1:~ }| + {1:~ }| + {1:~ }| + | + ]]} + + -- nvim_command causes a vimL exception, check that it is properly caught + -- and propagated as an error message in async contexts.. #10809 + exec_lua([[ + vim.schedule(function() + vim.api.nvim_command(":echo 'err") + end) + ]]) + screen:expect{grid=[[ + | + {2: }| + {3:Error executing vim.schedule lua callback: [string "<nvim>"]}| + {3::2: Vim(echo):E115: Missing quote: 'err} | + {4:Press ENTER or type command to continue}^ | + ]]} end) it("vim.split", function() |