Mercurial > vim
diff src/testdir/test_vim9_script.vim @ 23360:eb7d8f39363c v8.2.2223
patch 8.2.2223: Vim9: Reloading marks a :def function as deleted
Commit: https://github.com/vim/vim/commit/cdc40c43f1008bda2f173d3a13606236679e8067
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Dec 26 17:43:08 2020 +0100
patch 8.2.2223: Vim9: Reloading marks a :def function as deleted
Problem: Vim9: Reloading marks a :def function as deleted.
Solution: Clear the function contents but keep the index.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 26 Dec 2020 17:45:03 +0100 |
parents | b3142fc0a414 |
children | f181fe2150ab |
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -1174,10 +1174,7 @@ def Test_vim9script_reload_noclear() var s:notReloaded = 'yes' s:reloaded = 'first' def g:Values(): list<string> - return [s:reloaded, s:notReloaded, Once()] - enddef - def g:CallAgain(): string - return Again() + return [s:reloaded, s:notReloaded, Again(), Once()] enddef def Once(): string @@ -1188,20 +1185,16 @@ def Test_vim9script_reload_noclear() g:loadCount = 0 source XReloaded assert_equal(1, g:loadCount) - assert_equal(['first', 'yes', 'once'], g:Values()) - assert_equal('again', g:CallAgain()) + assert_equal(['first', 'yes', 'again', 'once'], g:Values()) source XReloaded assert_equal(2, g:loadCount) - assert_equal(['init', 'yes', 'once'], g:Values()) - assert_fails('call g:CallAgain()', 'E933:') + assert_equal(['init', 'yes', 'again', 'once'], g:Values()) source XReloaded assert_equal(3, g:loadCount) - assert_equal(['init', 'yes', 'once'], g:Values()) - assert_fails('call g:CallAgain()', 'E933:') + assert_equal(['init', 'yes', 'again', 'once'], g:Values()) delete('Xreloaded') delfunc g:Values - delfunc g:CallAgain unlet g:loadCount enddef