]> granicus.if.org Git - vim/commitdiff
patch 8.1.0316: swapinfo() test fails on Travis v8.1.0316
authorBram Moolenaar <Bram@vim.org>
Wed, 22 Aug 2018 09:28:01 +0000 (11:28 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 22 Aug 2018 09:28:01 +0000 (11:28 +0200)
Problem:    swapinfo() test fails on Travis.
Solution:   Handle a long host name. (Ozaki Kiichi, closes #3361)
            Also make the version check flexible. (James McCoy)

src/testdir/test_swap.vim
src/version.c

index c12693c81c3e8d2b55f2f7127d281edf4a0ae218..ca4d8c268c41632b53656e942c8bfa62903c3f5b 100644 (file)
@@ -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)
index 6b79b6e5428229743dc82f10d992bbaab9f91154..0ffd11e4f5b9188dca2251bcc942a987d32e5443 100644 (file)
@@ -794,6 +794,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    316,
 /**/
     315,
 /**/