Mercurial > vim
changeset 21709:16d6b626aa8f v8.2.1404
patch 8.2.1404: Vim9: script test fails in the GUI
Commit: https://github.com/vim/vim/commit/b3ca98240761d8f320c5a49e077d1aac6496bb21
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 9 14:43:58 2020 +0200
patch 8.2.1404: Vim9: script test fails in the GUI
Problem: Vim9: script test fails in the GUI.
Solution: Use another key to map. Improve cleanup.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 09 Aug 2020 14:45:04 +0200 |
parents | e47326f0192a |
children | 966d5daed211 |
files | src/testdir/test_vim9_script.vim src/version.c |
diffstat | 2 files changed, 15 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -1117,6 +1117,11 @@ let s:export_script_lines =<< trim END enddef END +def Undo_export_script_lines() + unlet g:result + unlet g:localname +enddef + def Test_vim9_import_export() let import_script_lines =<< trim END vim9script @@ -1155,8 +1160,7 @@ def Test_vim9_import_export() assert_equal('John Doe', g:imported_name_appended) assert_false(exists('g:name')) - unlet g:result - unlet g:localname + Undo_export_script_lines() unlet g:imported unlet g:imported_added unlet g:imported_later @@ -1441,18 +1445,18 @@ def Test_use_import_in_mapping() lines =<< trim END vim9script import Funcx from './XsomeExport.vim' - nnoremap <C-B> :call <sid>Funcx()<cr> + nnoremap <F3> :call <sid>Funcx()<cr> END writefile(lines, 'Xmapscript.vim') source Xmapscript.vim - feedkeys("\<c-b>", "xt") + feedkeys("\<F3>", "xt") assert_equal(42, g:result) unlet g:result delete('XsomeExport.vim') delete('Xmapscript.vim') - nunmap <C-B> + nunmap <F3> enddef def Test_vim9script_fails() @@ -1697,6 +1701,8 @@ def Test_import_absolute() '4 LOADSCRIPT exported from .*Xexport_abs.vim.*' .. '5 STOREG g:imported_after.*', g:import_disassembled) + + Undo_export_script_lines() unlet g:imported_abs unlet g:import_disassembled @@ -1720,8 +1726,9 @@ def Test_import_rtp() &rtp = save_rtp assert_equal(9876, g:imported_rtp) + + Undo_export_script_lines() unlet g:imported_rtp - delete('Ximport_rtp.vim') delete('import', 'rf') enddef