patch 9.1.1438: tests: Test_breakindent_list_split() fails

Problem:  tests: Test_breakindent_list_split() fails
          (Phạm Bình An)
Solution: Always reset "&columns" and "&lines" for GUI builds
          (Aliaksei Budavei)

Ensure that "&columns" and "&lines" are always set to their
default values before calling "SetUp()", if any, for EACH
test run by a GUI build to avoid yet-to-be-run tests from
inheriting possibly changed values (after window resizing)
and leading to broken assumptions about available estate and
occasional test failures.

fixes: #17453
closes: #17447

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index 0d53121..f03fe44 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -56,10 +56,17 @@
 " In the GUI we can always change the screen size.
 if has('gui_running')
   if has('gui_gtk')
-    " to keep screendump size unchanged
+    " Use e.g. SetUp() and TearDown() to change "&guifont" when needed;
+    " otherwise, keep the following value to match current screendumps.
     set guifont=Monospace\ 10
   endif
-  set columns=80 lines=25
+
+  func s:SetDefaultOptionsForGUIBuilds()
+    set columns=80 lines=25
+  endfunc
+else
+  func s:SetDefaultOptionsForGUIBuilds()
+  endfunc
 endif
 
 " Check that the screen size is at least 24 x 80 characters.
@@ -272,6 +279,9 @@
   " directory after executing the test.
   let save_cwd = getcwd()
 
+  " Permit "SetUp()" implementations to override default settings.
+  call s:SetDefaultOptionsForGUIBuilds()
+
   if exists("*SetUp")
     try
       call SetUp()