From 248be5c5de723c4e2715c574fd920b8b1a1dfebb Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 5 May 2018 15:47:19 +0200 Subject: patch 8.0.1793: no test for "vim -g" Problem: No test for "vim -g". Solution: Add a test for "-g" and "-y". --- src/testdir/test_gui.vim | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/testdir/test_gui.vim') diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim index 9d8a36f18..60e2bf412 100644 --- 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 -- cgit v1.2.1