aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-19 11:06:51 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-04-19 11:29:35 +0800
commit94a7ccea438fc638f4f90589ca1dddc8f9bab103 (patch)
tree9daeb50c2f74051be5a615ba421e20e1f2417cb8
parent85c61d67160133ba53762bc1e5e7bbd7a0c582c0 (diff)
downloadrneovim-94a7ccea438fc638f4f90589ca1dddc8f9bab103.tar.gz
rneovim-94a7ccea438fc638f4f90589ca1dddc8f9bab103.tar.bz2
rneovim-94a7ccea438fc638f4f90589ca1dddc8f9bab103.zip
vim-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. https://github.com/vim/vim/commit/6cf3151f0e3839332c89367b7384c395a1185927 Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r--test/old/testdir/test_swap.vim8
-rw-r--r--test/old/testdir/test_vimscript.vim3
2 files changed, 8 insertions, 3 deletions
diff --git a/test/old/testdir/test_swap.vim b/test/old/testdir/test_swap.vim
index 2786807e2e..fac1893e4c 100644
--- a/test/old/testdir/test_swap.vim
+++ b/test/old/testdir/test_swap.vim
@@ -116,16 +116,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)
diff --git a/test/old/testdir/test_vimscript.vim b/test/old/testdir/test_vimscript.vim
index 81ccee9f13..fe6c4c2391 100644
--- a/test/old/testdir/test_vimscript.vim
+++ b/test/old/testdir/test_vimscript.vim
@@ -5983,6 +5983,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