]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1438: tests: Test_breakindent_list_split() fails v9.1.1438
authorAliaksei Budavei <0x000c70@gmail.com>
Sun, 8 Jun 2025 13:52:42 +0000 (15:52 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 8 Jun 2025 13:52:42 +0000 (15:52 +0200)
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>
src/testdir/runtest.vim
src/testdir/test_highlight.vim
src/version.c

index 0d531215574d379d33fc8383035aebc991c63ac6..f03fe44499e1b0db3afb745ec53fc38364f3784b 100644 (file)
@@ -56,10 +56,17 @@ silent! endwhile
 " 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 @@ func RunTheTest(test)
   " 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()
index 5189b618cfe2558c29fdfc6d3f3dcb56e038f4f7..91423eb96eb1300238bf47f98422dc18d0c45007 100644 (file)
@@ -1144,6 +1144,17 @@ endfunc
 
 " Test for the hlset() function
 func Test_hlset()
+  " FIXME: With GVim, _current_ test cases that are run before this one may
+  "    influence the result of calling "hlset(hlget())", depending on what
+  "    "&guifont" is set to.  For example, introduce SetUp() as follows:
+  "
+  " if CanRunVimInTerminal() && has('gui_running') && has('gui_gtk')
+  "   def SetUp()
+  "     set guifont=Monospace\ 10
+  "   enddef
+  " endif
+  "
+  "    and see "E416: Missing equal sign: ... line 4" for this test case.
   let lines =<< trim END
     call assert_equal(0, hlset(test_null_list()))
     call assert_equal(0, hlset([]))
index 3d83858bab56a27adaede42bacfcca5395f7e7ca..6896410fbfa0a614ff07720529255a603b3ff97c 100644 (file)
@@ -709,6 +709,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1438,
 /**/
     1437,
 /**/