@@ -405,6 +405,7 @@ func Test_func_def_error()
405405 let l = join (lines , " \n " ) . " \n "
406406 exe l
407407 call assert_fails (' exe l' , ' E717:' )
408+ call assert_fails (' call feedkeys(":func d.F1()\<CR>", "xt")' , ' E717:' )
408409
409410 " Define an autoload function with an incorrect file name
410411 call writefile ([' func foo#Bar()' , ' return 1' , ' endfunc' ], ' Xscript' )
@@ -420,6 +421,11 @@ func Test_del_func()
420421 call assert_fails (' delfunction Xabc' , ' E130:' )
421422 let d = {' a' : 10 }
422423 call assert_fails (' delfunc d.a' , ' E718:' )
424+ func d .fn ()
425+ return 1
426+ endfunc
427+ delfunc d .fn
428+ call assert_equal ({' a' : 10 }, d )
423429endfunc
424430
425431" Test for calling return outside of a function
@@ -451,11 +457,12 @@ func Test_func_dict()
451457 return len (self )
452458 endfunc
453459
454- call assert_equal (" {'a': 'b', 'somefunc': function('2 ')}" , string (mydict))
460+ call assert_equal (" {'a': 'b', 'somefunc': function('3 ')}" , string (mydict))
455461 call assert_equal (2 , mydict.somefunc ())
456462 call assert_match (" ^\n function \\ d\\ \+ () dict"
457463 \ .. " \n 1 return len(self)"
458464 \ .. " \n endfunction$" , execute (' func mydict.somefunc' ))
465+ call assert_fails (' call mydict.nonexist()' , ' E716:' )
459466endfunc
460467
461468func Test_func_range ()
0 commit comments