@@ -278,9 +278,9 @@ func Test_python_range()
278278 py r [1 :0 ] = [" d" ]
279279 call assert_equal ([' c' , ' d' , ' a' , ' two' , ' three' , ' b' ], getline (1 , ' $' ))
280280
281- " FIXME: The following code triggers ml_get errors
282- " %d
283- " let x = pyeval('r[:]')
281+ " The following code used to trigger an ml_get error
282+ % d
283+ let x = pyeval (' r[:]' )
284284
285285 " Non-existing range attribute
286286 call AssertException ([" let x = pyeval('r.abc')" ],
@@ -332,9 +332,9 @@ func Test_python_window()
332332 call AssertException ([" py vim.current.window = w" ],
333333 \ ' Vim(python):vim.error: attempt to refer to deleted window' )
334334 " Try to set one of the options of the closed window
335- " FIXME: The following causes ASAN failure
336- " call AssertException(["py wopts['list'] = False"],
337- " \ 'vim.error: problem while switching windows ')
335+ " The following caused an ASAN failure
336+ call AssertException ([" py wopts['list'] = False" ],
337+ \ ' vim.error: attempt to refer to deleted window ' )
338338 call assert_match (' <window object (deleted)' , pyeval (" repr(w)" ))
339339 % bw !
340340endfunc
@@ -623,6 +623,9 @@ func Test_python_slice_assignment()
623623 py l = vim .bindeval (' l' )
624624 py l [2 :2 :1 ] = ()
625625 call assert_equal ([0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ], l )
626+
627+ call AssertException ([" py x = l[10:11:0]" ],
628+ \ " Vim(python):ValueError: slice step cannot be zero" )
626629endfunc
627630
628631" Locked variables
@@ -809,6 +812,10 @@ func Test_python_vim_bindeval()
809812 call assert_equal (0 , pyeval (" vim.bindeval('v:false')" ))
810813 call assert_equal (v: none , pyeval (" vim.bindeval('v:null')" ))
811814 call assert_equal (v: none , pyeval (" vim.bindeval('v:none')" ))
815+
816+ " channel/job
817+ call assert_equal (v: none , pyeval (" vim.bindeval('test_null_channel()')" ))
818+ call assert_equal (v: none , pyeval (" vim.bindeval('test_null_job()')" ))
812819endfunc
813820
814821" threading
@@ -1402,6 +1409,20 @@ func Test_python_buffer()
14021409 call assert_equal ([], pyeval (' b[2:0]' ))
14031410 call assert_equal ([], pyeval (' b[10:12]' ))
14041411 call assert_equal ([], pyeval (' b[-10:-8]' ))
1412+ call AssertException ([" py x = b[0:3:0]" ],
1413+ \ " Vim(python):TypeError: sequence index must be integer, not 'slice'" )
1414+ call AssertException ([" py b[0:3:0] = 'abc'" ],
1415+ \ " Vim(python):TypeError: sequence index must be integer, not 'slice'" )
1416+ call AssertException ([" py x = b[{}]" ],
1417+ \ " Vim(python):TypeError: sequence index must be integer, not 'dict'" )
1418+ call AssertException ([" py b[{}] = 'abc'" ],
1419+ \ " Vim(python):TypeError: sequence index must be integer, not 'dict'" )
1420+
1421+ " Test for getting lines using a range
1422+ call AssertException ([" py x = b.range(0,3)[0:2:0]" ],
1423+ \ " Vim(python):TypeError: sequence index must be integer, not 'slice'" )
1424+ call AssertException ([" py b.range(0,3)[0:2:0] = 'abc'" ],
1425+ \ " Vim(python):TypeError: sequence index must be integer, not 'slice'" )
14051426
14061427 " Tests BufferAppend and BufferItem
14071428 py cb .append (b [0 ])
@@ -1512,6 +1533,9 @@ func Test_python_buffer()
15121533 py vim .current.buffer [:] = []
15131534 call assert_equal ([' ' ], getline (1 , ' $' ))
15141535
1536+ " Test for buffer marks
1537+ call assert_equal (v: none , pyeval (" vim.current.buffer.mark('r')" ))
1538+
15151539 " Test for modifying a 'nomodifiable' buffer
15161540 setlocal nomodifiable
15171541 call AssertException ([" py vim.current.buffer[0] = 'abc'" ],
@@ -2408,6 +2432,7 @@ func Test_python_chdir()
24082432 call assert_equal ([' testdir' , ' Xfile' , ' src' , ' testdir/Xfile' , ' testdir' ,
24092433 \ ' Xfile' ], getline (2 , ' $' ))
24102434 close !
2435+ call AssertException ([" py vim.chdir(None)" ], " Vim(python):TypeError:" )
24112436endfunc
24122437
24132438" Test errors
0 commit comments