call assert_fails("call luaeval('vim.call(\"type\", co)')",
\ '[string "luaeval"]:1: lua: cannot convert value')
lua co = nil
- call assert_fails("call luaeval('vim.call(\"abc\")')", '[string "luaeval"]:1: lua: call_vim_function failed')
+ call assert_fails("call luaeval('vim.call(\"abc\")')", ['E117:', '\[string "luaeval"]:1: lua: call_vim_function failed'])
endfunc
" Test vim.fn.*
call assert_fails('lua f1 = vim.funcref(fname)',
\ "[string \"vim chunk\"]:1: bad argument #1 to 'funcref' (string expected, got nil)")
call assert_fails('lua vim.funcref("abc")()',
- \ '[string "vim chunk"]:1: cannot call funcref')
+ \ ['E117:', '\[string "vim chunk"]:1: cannot call funcref'])
" dict funcref
function Mylen() dict
" Try to run a command in a 'nomodifiable' buffer
call setline(1, ['one', 'two', 'three'])
set nomodifiable
- call assert_fails('tcldo set line "abc"', 'cannot save undo information')
+ call assert_fails('tcldo set line "abc"',
+ \ ['E21:', 'cannot save undo information'])
set modifiable
%bwipe!
" Try to delete lines from an 'nomodifiable' buffer
set nomodifiable
call assert_fails('tcl $::vim::current(buffer) delete 2 1',
- \ 'cannot save undo information')
+ \ ['E21:', 'cannot save undo information'])
set modifiable
bwipe!
" Try to append lines to a 'nomodifiable' buffer
set nomodifiable
call assert_fails('tcl $buf append 1 "first"',
- \ 'cannot save undo information')
+ \ ['E21:', 'cannot save undo information'])
set modifiable
tcl unset buf
" Try to modify a 'nomodifiable' buffer
set nomodifiable
call assert_fails('tcl $::vim::current(buffer) set 1 "x"',
- \ 'cannot save undo information')
+ \ ['E21:', 'cannot save undo information'])
call assert_fails('tcl $::vim::current(buffer) set 1 {a b}',
- \ 'cannot save undo information')
+ \ ['E21:', 'cannot save undo information'])
call assert_fails('tcl $::vim::current(buffer) set 1 2 {a b}',
- \ 'cannot save undo information')
+ \ ['E21:', 'cannot save undo information'])
set modifiable
bwipe!
endfunc