Patch 8.1.0536
Problem: File time test fails when using NFS.
Solution: Use three file times instead of localtim(). (James McCoy,
closes #3618)
Files: src/testdir/test_stat.vim
*** ../vim-8.1.0535/src/testdir/test_stat.vim 2018-08-22 20:16:11.985125882
+0200
--- src/testdir/test_stat.vim 2018-11-18 12:19:41.877543229 +0100
***************
*** 1,31 ****
" Tests for stat functions and checktime
func CheckFileTime(doSleep)
! let fname = 'Xtest.tmp'
let result = 0
! let ts = localtime()
! if a:doSleep
! sleep 1
! endif
let fl = ['Hello World!']
! call writefile(fl, fname)
! let tf = getftime(fname)
! if a:doSleep
! sleep 1
! endif
! let te = localtime()
! let time_correct = (ts <= tf && tf <= te)
if a:doSleep || time_correct
! call assert_true(time_correct)
! call assert_equal(strlen(fl[0] . "\n"), getfsize(fname))
! call assert_equal('file', getftype(fname))
! call assert_equal('rw-', getfperm(fname)[0:2])
let result = 1
endif
! call delete(fname)
return result
endfunc
--- 1,33 ----
" Tests for stat functions and checktime
func CheckFileTime(doSleep)
! let fnames = ['Xtest1.tmp', 'Xtest2.tmp', 'Xtest3.tmp']
! let times = []
let result = 0
! " Use three files istead of localtim(), with a network filesystem the file
! " times may differ at bit
let fl = ['Hello World!']
! for fname in fnames
! call writefile(fl, fname)
! call add(times, getftime(fname))
! if a:doSleep
! sleep 1
! endif
! endfor
! let time_correct = (times[0] <= times[1] && times[1] <= times[2])
if a:doSleep || time_correct
! call assert_true(time_correct, printf('Expected %s <= %s <= %s',
times[0], times[1], times[2]))
! call assert_equal(strlen(fl[0] . "\n"), getfsize(fnames[0]))
! call assert_equal('file', getftype(fnames[0]))
! call assert_equal('rw-', getfperm(fnames[0])[0:2])
let result = 1
endif
! for fname in fnames
! call delete(fname)
! endfor
return result
endfunc
*** ../vim-8.1.0535/src/version.c 2018-11-16 20:54:27.053554626 +0100
--- src/version.c 2018-11-18 12:23:05.864278755 +0100
***************
*** 794,795 ****
--- 794,797 ----
{ /* Add new patch number below this line */
+ /**/
+ 536,
/**/
--
Vi beats Emacs to death, and then again!
http://linuxtoday.com/stories/5764.html
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.