Mercurial > vim
diff src/testdir/test_vim9_script.vim @ 19443:6b1a59e71f85 v8.2.0279
patch 8.2.0279: Vim9: no test for deleted :def function
Commit: https://github.com/vim/vim/commit/63ce4849efa54d3980446ad337d0e1248ec86182
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Feb 19 15:46:48 2020 +0100
patch 8.2.0279: Vim9: no test for deleted :def function
Problem: Vim9: no test for deleted :def function.
Solution: Add a test. Clear uf_cleared flag when redefining a function.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 19 Feb 2020 16:00:04 +0100 |
parents | d6e8a9e80be4 |
children | 6e27e1ffa2a6 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -477,5 +477,26 @@ def Test_if_elseif_else() assert_equal('three', IfElse(3)) enddef +def Test_delfunc() + let lines =<< trim END + vim9script + def GoneSoon() + echo 'hello' + enddef + + def CallGoneSoon() + GoneSoon() + enddef + + delfunc GoneSoon + CallGoneSoon() + END + writefile(lines, 'XToDelFunc') + assert_fails('so XToDelFunc', 'E933') + assert_fails('so XToDelFunc', 'E933') + + delete('XToDelFunc') +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker