changeset 31349:22d11340ee68 v9.0.1008

patch 9.0.1008: test for swapfilelist() fails on MS-Windows Commit: https://github.com/vim/vim/commit/6cf3151f0e3839332c89367b7384c395a1185927 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Dec 5 15:01:05 2022 +0000 patch 9.0.1008: test for swapfilelist() fails on MS-Windows Problem: Test for swapfilelist() fails on MS-Windows. Solution: Only check the tail of the path. Mark a test as flaky.
author Bram Moolenaar <Bram@vim.org>
date Mon, 05 Dec 2022 16:15:04 +0100
parents fa722fa1b6e6
children 0f05b4340c6a
files src/testdir/test_swap.vim src/testdir/test_vimscript.vim src/version.c
diffstat 3 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_swap.vim
+++ b/src/testdir/test_swap.vim
@@ -111,16 +111,18 @@ func Test_swapinfo()
   let fname = s:swapname()
   call assert_match('Xswapinfo', fname)
 
+  " Check the tail appears in the list from swapfilelist().  The path depends
+  " on the system.
+  let tail = fnamemodify(fname, ":t")->fnameescape()
   let nr = 0
   for name in swapfilelist()
-    if name =~ '[\\/]' .. fname .. '$'
+    if name =~ tail .. '$'
       let nr += 1
     endif
   endfor
-  call assert_equal(1, nr)
+  call assert_equal(1, nr, 'not found in ' .. string(swapfilelist()))
 
   let info = fname->swapinfo()
-
   let ver = printf('VIM %d.%d', v:version / 100, v:version % 100)
   call assert_equal(ver, info.version)
 
--- a/src/testdir/test_vimscript.vim
+++ b/src/testdir/test_vimscript.vim
@@ -5977,6 +5977,9 @@ endfunc
 
 " interrupt right before a catch is invoked in a script
 func Test_ignore_catch_after_intr_1()
+  " for unknown reasons this test sometimes fails on MS-Windows.
+  let g:test_is_flaky = 1
+
   XpathINIT
   let lines =<< trim [CODE]
     try
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1008,
+/**/
     1007,
 /**/
     1006,