comparison src/testdir/test_swap.vim @ 14605:0c47880f3d95 v8.1.0316

patch 8.1.0316: swapinfo() test fails on Travis commit https://github.com/vim/vim/commit/4c5765bc47b2708075e8d8471e8d342079479777 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 22 11:28:01 2018 +0200 patch 8.1.0316: swapinfo() test fails on Travis Problem: swapinfo() test fails on Travis. Solution: Handle a long host name. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/3361) Also make the version check flexible. (James McCoy)
author Christian Brabandt <cb@256bit.org>
date Wed, 22 Aug 2018 11:30:05 +0200
parents d0ff19a55579
children 20653d6f3d95
comparison
equal deleted inserted replaced
14604:b16163358e63 14605:0c47880f3d95
103 call setline(1, ['one', 'two', 'three']) 103 call setline(1, ['one', 'two', 'three'])
104 w 104 w
105 let fname = trim(execute('swapname')) 105 let fname = trim(execute('swapname'))
106 call assert_match('Xswapinfo', fname) 106 call assert_match('Xswapinfo', fname)
107 let info = swapinfo(fname) 107 let info = swapinfo(fname)
108 call assert_match('8\.', info.version) 108
109 let ver = printf('VIM %d.%d', v:version / 100, v:version % 100)
110 call assert_equal(ver, info.version)
111
109 call assert_match('\w', info.user) 112 call assert_match('\w', info.user)
110 call assert_equal(hostname(), info.host) 113 " host name is truncated to 39 bytes in the swap file
114 call assert_equal(hostname()[:38], info.host)
111 call assert_match('Xswapinfo', info.fname) 115 call assert_match('Xswapinfo', info.fname)
112 call assert_match(0, info.dirty) 116 call assert_match(0, info.dirty)
113 call assert_equal(getpid(), info.pid) 117 call assert_equal(getpid(), info.pid)
114 call assert_match('^\d*$', info.mtime) 118 call assert_match('^\d*$', info.mtime)
115 if has_key(info, 'inode') 119 if has_key(info, 'inode')