mirror of
https://github.com/vim/vim.git
synced 2025-12-23 12:15:17 +01:00
patch 9.1.1968: tests: test_python3.vim leaves swapfiles behind
Problem: tests: test_python3.vim leaves swapfiles behind Solution: Close open buffers using :bw! instead of :close! Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -518,7 +518,7 @@ func Test_python3_range2()
|
|||||||
call AssertException(["let x = py3eval('r.abc')"],
|
call AssertException(["let x = py3eval('r.abc')"],
|
||||||
\ "Vim(let):AttributeError: 'vim.range' object has no attribute 'abc'")
|
\ "Vim(let):AttributeError: 'vim.range' object has no attribute 'abc'")
|
||||||
|
|
||||||
close!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for the python tabpage object
|
" Test for the python tabpage object
|
||||||
@@ -995,7 +995,7 @@ func Test_python3_lockedvar()
|
|||||||
|
|
||||||
call assert_equal([0, 1, 2, 3], l)
|
call assert_equal([0, 1, 2, 3], l)
|
||||||
unlockvar! l
|
unlockvar! l
|
||||||
close!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for calling a function
|
" Test for calling a function
|
||||||
@@ -1024,7 +1024,7 @@ func Test_python3_function_call()
|
|||||||
delfunction New
|
delfunction New
|
||||||
py3 ee('f(1, 2, 3)')
|
py3 ee('f(1, 2, 3)')
|
||||||
call assert_equal("f(1, 2, 3):(<class 'vim.error'>, error('Vim:E117: Unknown function: New',))", getline(2))
|
call assert_equal("f(1, 2, 3):(<class 'vim.error'>, error('Vim:E117: Unknown function: New',))", getline(2))
|
||||||
close!
|
bw!
|
||||||
delfunction DictNew
|
delfunction DictNew
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@@ -2927,7 +2927,7 @@ func Test_python3_chdir()
|
|||||||
EOF
|
EOF
|
||||||
call assert_equal(["b'testdir'", 'Xp3cdfile', "b'src'", 'testdir/Xp3cdfile',
|
call assert_equal(["b'testdir'", 'Xp3cdfile', "b'src'", 'testdir/Xp3cdfile',
|
||||||
\"b'testdir'", 'Xp3cdfile'], getline(2, '$'))
|
\"b'testdir'", 'Xp3cdfile'], getline(2, '$'))
|
||||||
close!
|
bw!
|
||||||
call AssertException(["py3 vim.chdir(None)"], "Vim(py3):TypeError:")
|
call AssertException(["py3 vim.chdir(None)"], "Vim(py3):TypeError:")
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@@ -4139,7 +4139,7 @@ func Test_python3_errors()
|
|||||||
for i in range(n_expected > n_actual ? n_expected : n_actual)
|
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])
|
call assert_equal(i >= n_expected ? '' : expected[i], i >= n_actual ? '' : actual[i])
|
||||||
endfor
|
endfor
|
||||||
close!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test import
|
" Test import
|
||||||
@@ -4195,7 +4195,7 @@ func Test_python3_import()
|
|||||||
pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py
|
pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py
|
||||||
END
|
END
|
||||||
call assert_equal(expected, getline(2, '$'))
|
call assert_equal(expected, getline(2, '$'))
|
||||||
close!
|
bw!
|
||||||
|
|
||||||
" Try to import a non-existing module with a dot (.)
|
" Try to import a non-existing module with a dot (.)
|
||||||
call AssertException(['py3 import a.b.c'], "No module named 'a'")
|
call AssertException(['py3 import a.b.c'], "No module named 'a'")
|
||||||
@@ -4233,7 +4233,7 @@ func Test_python3_exception()
|
|||||||
vim.bindeval("Exe('xxx_non_existent_command_xxx')"):(<class 'vim.error'>, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',))
|
vim.bindeval("Exe('xxx_non_existent_command_xxx')"):(<class 'vim.error'>, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',))
|
||||||
END
|
END
|
||||||
call assert_equal(expected, getline(2, '$'))
|
call assert_equal(expected, getline(2, '$'))
|
||||||
close!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Regression: interrupting vim.command propagates to next vim.command
|
" Regression: interrupting vim.command propagates to next vim.command
|
||||||
@@ -4277,7 +4277,7 @@ func Test_python3_keyboard_interrupt()
|
|||||||
END
|
END
|
||||||
call assert_equal(expected, getline(2, '$'))
|
call assert_equal(expected, getline(2, '$'))
|
||||||
call assert_equal('', output)
|
call assert_equal('', output)
|
||||||
close!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Regression: Iterator for a Vim object should hold a reference.
|
" Regression: Iterator for a Vim object should hold a reference.
|
||||||
|
|||||||
@@ -729,6 +729,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1968,
|
||||||
/**/
|
/**/
|
||||||
1967,
|
1967,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user