aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir/test_swap.vim
diff options
context:
space:
mode:
Diffstat (limited to 'test/old/testdir/test_swap.vim')
-rw-r--r--test/old/testdir/test_swap.vim13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/old/testdir/test_swap.vim b/test/old/testdir/test_swap.vim
index 4241f4fd69..fac1893e4c 100644
--- a/test/old/testdir/test_swap.vim
+++ b/test/old/testdir/test_swap.vim
@@ -115,8 +115,19 @@ func Test_swapinfo()
w
let fname = s:swapname()
call assert_match('Xswapinfo', fname)
- let info = fname->swapinfo()
+ " 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 =~ tail .. '$'
+ let nr += 1
+ endif
+ endfor
+ 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)