summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_gui.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-05-05 15:47:19 +0200
committerBram Moolenaar <Bram@vim.org>2018-05-05 15:47:19 +0200
commit248be5c5de723c4e2715c574fd920b8b1a1dfebb (patch)
treeab2b73b2060443d2c7e243a5f36bf89b6a5b3c38 /src/testdir/test_gui.vim
parentc3e81694fca484ebabd99f3637bd83b9ee2dd50a (diff)
patch 8.0.1793: no test for "vim -g"v8.0.1793
Problem: No test for "vim -g". Solution: Add a test for "-g" and "-y".
Diffstat (limited to 'src/testdir/test_gui.vim')
-rw-r--r--src/testdir/test_gui.vim30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim
index 9d8a36f188..60e2bf412e 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