summaryrefslogtreecommitdiff
path: root/src/testdir/test_swap.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-08-22 11:28:01 +0200
committerBram Moolenaar <Bram@vim.org>2018-08-22 11:28:01 +0200
commit4c5765bc47b2708075e8d8471e8d342079479777 (patch)
tree03a961b039713c4f1c0a7f2a087bec43023af837 /src/testdir/test_swap.vim
parentc631f2df624954184509df49479d52ad7fe5233b (diff)
downloadvim-git-4c5765bc47b2708075e8d8471e8d342079479777.tar.gz
patch 8.1.0316: swapinfo() test fails on Travisv8.1.0316
Problem: swapinfo() test fails on Travis. Solution: Handle a long host name. (Ozaki Kiichi, closes #3361) Also make the version check flexible. (James McCoy)
Diffstat (limited to 'src/testdir/test_swap.vim')
-rw-r--r--src/testdir/test_swap.vim8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/testdir/test_swap.vim b/src/testdir/test_swap.vim
index c12693c81..ca4d8c268 100644
--- a/src/testdir/test_swap.vim
+++ b/src/testdir/test_swap.vim
@@ -105,9 +105,13 @@ func Test_swapinfo()
let fname = trim(execute('swapname'))
call assert_match('Xswapinfo', fname)
let info = swapinfo(fname)
- call assert_match('8\.', info.version)
+
+ let ver = printf('VIM %d.%d', v:version / 100, v:version % 100)
+ call assert_equal(ver, info.version)
+
call assert_match('\w', info.user)
- call assert_equal(hostname(), info.host)
+ " host name is truncated to 39 bytes in the swap file
+ call assert_equal(hostname()[:38], info.host)
call assert_match('Xswapinfo', info.fname)
call assert_match(0, info.dirty)
call assert_equal(getpid(), info.pid)