Mercurial > vim
diff src/testdir/test_gui.vim @ 13843:619730d0d864 v8.0.1793
patch 8.0.1793: no test for "vim -g"
commit https://github.com/vim/vim/commit/248be5c5de723c4e2715c574fd920b8b1a1dfebb
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 5 15:47:19 2018 +0200
patch 8.0.1793: no test for "vim -g"
Problem: No test for "vim -g".
Solution: Add a test for "-g" and "-y".
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 05 May 2018 16:00:07 +0200 |
parents | cad480bac9e1 |
children | 70e36e1ca442 |
line wrap: on
line diff
--- a/src/testdir/test_gui.vim +++ b/src/testdir/test_gui.vim @@ -706,3 +706,33 @@ func Test_windowid_variable() call assert_equal(0, v:windowid) endif endfunc + +" Test "vim -g" and also the GUIEnter autocommand. +func Test_gui_dash_g() + let cmd = GetVimCommand('Xscriptgui') + call writefile([""], "Xtestgui") + call writefile([ + \ 'au GUIEnter * call writefile(["insertmode: " . &insertmode], "Xtestgui")', + \ 'au GUIEnter * qall', + \ ], 'Xscriptgui') + call system(cmd . ' -g') + call WaitForAssert({-> assert_equal(['insertmode: 0'], readfile('Xtestgui'))}) + + call delete('Xscriptgui') + call delete('Xtestgui') +endfunc + +" Test "vim -7" and also the GUIEnter autocommand. +func Test_gui_dash_y() + let cmd = GetVimCommand('Xscriptgui') + call writefile([""], "Xtestgui") + call writefile([ + \ 'au GUIEnter * call writefile(["insertmode: " . &insertmode], "Xtestgui")', + \ 'au GUIEnter * qall', + \ ], 'Xscriptgui') + call system(cmd . ' -y') + call WaitForAssert({-> assert_equal(['insertmode: 1'], readfile('Xtestgui'))}) + + call delete('Xscriptgui') + call delete('Xtestgui') +endfunc