return {'a': 1}
endfunction
+let s:system_error_pat = 'Vim(py3):SystemError: \(<built-in function eval> returned NULL without setting an error\|error return without exception set\)'
" This function should be called first. This sets up python functions used by
" the other tests.
func Test_python3_list()
" Try to convert a null List
call AssertException(["py3 t = vim.eval('test_null_list()')"],
- \ 'Vim(py3):SystemError: <built-in function eval> returned NULL without setting an error')
+ \ s:system_error_pat)
" Try to convert a List with a null List item
call AssertException(["py3 t = vim.eval('[test_null_list()]')"],
- \ 'Vim(py3):SystemError: <built-in function eval> returned NULL without setting an error')
+ \ s:system_error_pat)
" Try to bind a null List variable (works because an empty list is used)
let cmds =<< trim END
func Test_python3_dict()
" Try to convert a null Dict
call AssertException(["py3 t = vim.eval('test_null_dict()')"],
- \ 'Vim(py3):SystemError: <built-in function eval> returned NULL without setting an error')
+ \ s:system_error_pat)
" Try to convert a Dict with a null List value
call AssertException(["py3 t = vim.eval(\"{'a' : test_null_list()}\")"],
- \ 'Vim(py3):SystemError: <built-in function eval> returned NULL without setting an error')
+ \ s:system_error_pat)
" Try to convert a Dict with a null string key
py3 t = vim.eval("{test_null_string() : 10}")
let l = [test_null_list()]
py3 ll = vim.bindeval('l')
call AssertException(["py3 x = ll[:]"],
- \ "Vim(py3):SystemError: error return without exception set")
+ \ s:system_error_pat)
endfunc
" Vars