patch 9.0.1007: there is no way to get a list of swap file names
Problem: There is no way to get a list of swap file names.
Solution: Add the swapfilelist() function. Use it in the test script to
clean up. Remove deleting individual swap files.
diff --git a/src/testdir/test_swap.vim b/src/testdir/test_swap.vim
index 5237edc..c776ca5 100644
--- a/src/testdir/test_swap.vim
+++ b/src/testdir/test_swap.vim
@@ -110,6 +110,15 @@
w
let fname = s:swapname()
call assert_match('Xswapinfo', fname)
+
+ let nr = 0
+ for name in swapfilelist()
+ if name =~ '[\\/]' .. fname .. '$'
+ let nr += 1
+ endif
+ endfor
+ call assert_equal(1, nr)
+
let info = fname->swapinfo()
let ver = printf('VIM %d.%d', v:version / 100, v:version % 100)