diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-04-20 14:16:41 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-20 14:16:41 -0400 |
| commit | 4ceca862fceb021049144a9aed05c60ae39b7aba (patch) | |
| tree | b7b1f1e421aeeaa2d30a348745c17f9f9b69b8d7 /test/functional/vimscript/printf_spec.lua | |
| parent | faa7c15b5a711435ed9d90f7fbf2a2ff8f1255c7 (diff) | |
| download | rneovim-4ceca862fceb021049144a9aed05c60ae39b7aba.tar.gz rneovim-4ceca862fceb021049144a9aed05c60ae39b7aba.tar.bz2 rneovim-4ceca862fceb021049144a9aed05c60ae39b7aba.zip | |
refactor(test): drop deprecated exc_exec #39242
Diffstat (limited to 'test/functional/vimscript/printf_spec.lua')
| -rw-r--r-- | test/functional/vimscript/printf_spec.lua | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/test/functional/vimscript/printf_spec.lua b/test/functional/vimscript/printf_spec.lua index 91c3b996a4..cc2d114512 100644 --- a/test/functional/vimscript/printf_spec.lua +++ b/test/functional/vimscript/printf_spec.lua @@ -3,10 +3,11 @@ local n = require('test.functional.testnvim')() local clear = n.clear local eq = t.eq +local pcall_err = t.pcall_err local eval = n.eval local fn = n.fn local api = n.api -local exc_exec = n.exc_exec +local command = n.command describe('printf()', function() setup(clear) @@ -56,10 +57,13 @@ describe('printf()', function() eq('0b00011 ', fn.printf("% '+#0-10.5b", 3)) end) it('errors out when %b modifier is used for a list', function() - eq('Vim(call):E745: Using a List as a Number', exc_exec('call printf("%b", [])')) + eq('Vim(call):E745: Using a List as a Number', pcall_err(command, 'call printf("%b", [])')) end) it('errors out when %b modifier is used for a float', function() - eq('Vim(call):E805: Using a Float as a Number', exc_exec('call printf("%b", 3.1415926535)')) + eq( + 'Vim(call):E805: Using a Float as a Number', + pcall_err(command, 'call printf("%b", 3.1415926535)') + ) end) it('works with %p correctly', function() local null_ret = nil @@ -68,8 +72,8 @@ describe('printf()', function() -- address after freeing unreferenced values. api.nvim_set_var('__args', {}) local function check_printf(expr, is_null) - eq(0, exc_exec('call add(__args, ' .. expr .. ')')) - eq(0, exc_exec('let __result = printf("%p", __args[-1])')) + command('call add(__args, ' .. expr .. ')') + command('let __result = printf("%p", __args[-1])') local id_ret = eval('id(__args[-1])') eq(id_ret, api.nvim_get_var('__result')) if is_null then |