call AssertException(["let x = py3eval('r.abc')"],
\ "Vim(let):AttributeError: 'vim.range' object has no attribute 'abc'")
- close!
+ bw!
endfunc
" Test for the python tabpage object
call assert_equal([0, 1, 2, 3], l)
unlockvar! l
- close!
+ bw!
endfunc
" Test for calling a function
delfunction New
py3 ee('f(1, 2, 3)')
call assert_equal("f(1, 2, 3):(<class 'vim.error'>, error('Vim:E117: Unknown function: New',))", getline(2))
- close!
+ bw!
delfunction DictNew
endfunc
EOF
call assert_equal(["b'testdir'", 'Xp3cdfile', "b'src'", 'testdir/Xp3cdfile',
\"b'testdir'", 'Xp3cdfile'], getline(2, '$'))
- close!
+ bw!
call AssertException(["py3 vim.chdir(None)"], "Vim(py3):TypeError:")
endfunc
for i in range(n_expected > n_actual ? n_expected : n_actual)
call assert_equal(i >= n_expected ? '' : expected[i], i >= n_actual ? '' : actual[i])
endfor
- close!
+ bw!
endfunc
" Test import
pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py
END
call assert_equal(expected, getline(2, '$'))
- close!
+ bw!
" Try to import a non-existing module with a dot (.)
call AssertException(['py3 import a.b.c'], "No module named 'a'")
vim.bindeval("Exe('xxx_non_existent_command_xxx')"):(<class 'vim.error'>, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',))
END
call assert_equal(expected, getline(2, '$'))
- close!
+ bw!
endfunc
" Regression: interrupting vim.command propagates to next vim.command
END
call assert_equal(expected, getline(2, '$'))
call assert_equal('', output)
- close!
+ bw!
endfunc
" Regression: Iterator for a Vim object should hold a reference.