patch 8.0.1793: no test for "vim -g"
Problem: No test for "vim -g".
Solution: Add a test for "-g" and "-y".
diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim
index 9d8a36f..60e2bf4 100644
--- a/src/testdir/test_gui.vim
+++ b/src/testdir/test_gui.vim
@@ -706,3 +706,33 @@
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