]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1008: test for swapfilelist() fails on MS-Windows v9.0.1008
authorBram Moolenaar <Bram@vim.org>
Mon, 5 Dec 2022 15:01:05 +0000 (15:01 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 5 Dec 2022 15:01:05 +0000 (15:01 +0000)
Problem:    Test for swapfilelist() fails on MS-Windows.
Solution:   Only check the tail of the path.  Mark a test as flaky.

src/testdir/test_swap.vim
src/testdir/test_vimscript.vim
src/version.c

index c776ca57ce952b39ff93f0dcf2eec5e4a50b6dd5..7532655a36c54b0ee00b6c34623c7adda47e30ea 100644 (file)
@@ -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)
 
index a23bac3d3e3f5b895e1fdec2d87dbfe17a339140..5599754c7b1130ff530d18c87618af63ccbe973e 100644 (file)
@@ -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
index 4a15f431e0fa0ba99f52c1343b60f181f8b150b6..ce1aba06d4116cb92e32150cd2775c2396ae4556 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1008,
 /**/
     1007,
 /**/