diff options
Diffstat (limited to 'test/functional/lua/vim_spec.lua')
| -rw-r--r-- | test/functional/lua/vim_spec.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua index f9cd051d1f..0a76af70d1 100644 --- a/test/functional/lua/vim_spec.lua +++ b/test/functional/lua/vim_spec.lua @@ -1556,11 +1556,16 @@ describe('lua stdlib', function() pcall_err(exec_lua, "vim.validate('arg1', nil, {'number', 'string'})") ) - -- Pass an additional message back. + -- Validator func can return an extra "Info" message. matches( 'arg1: expected %?, got 3. Info: TEST_MSG', pcall_err(exec_lua, "vim.validate('arg1', 3, function(a) return a == 1, 'TEST_MSG' end)") ) + -- Caller can override the "expected" message. + eq( + 'arg1: expected TEST_MSG, got nil', + pcall_err(exec_lua, "vim.validate('arg1', nil, 'table', 'TEST_MSG')") + ) end) it('vim.validate (spec form)', function() |