comparison src/testdir/test_stat.vim @ 25953:d7e1cf30728c v8.2.3510

patch 8.2.3510: changes are only detected with one second accuracy Commit: https://github.com/vim/vim/commit/0a7984af5601323fae7b3398f05a48087db7b767 Author: Leah Neukirchen <leah@vuxu.org> Date: Thu Oct 14 21:27:55 2021 +0100 patch 8.2.3510: changes are only detected with one second accuracy Problem: Changes are only detected with one second accuracy. Solution: Use the nanosecond time if possible. (Leah Neukirchen, closes #8873, closes #8875)
author Bram Moolenaar <Bram@vim.org>
date Thu, 14 Oct 2021 22:30:04 +0200
parents 08940efa6b4e
children 08f63df32e8e
comparison
equal deleted inserted replaced
25952:7eded0585ee0 25953:d7e1cf30728c
72 call writefile(fl, fname) 72 call writefile(fl, fname)
73 checktime 73 checktime
74 call assert_equal(fl[0], getline(1)) 74 call assert_equal(fl[0], getline(1))
75 75
76 call delete(fname) 76 call delete(fname)
77 endfunc
78
79 func Test_checktime_fast()
80 CheckFeature nanotime
81
82 let fname = 'Xtest.tmp'
83
84 let fl = ['Hello World!']
85 call writefile(fl, fname)
86 set autoread
87 exec 'e' fname
88 let fl = readfile(fname)
89 let fl[0] .= ' - checktime'
90 call writefile(fl, fname)
91 checktime
92 call assert_equal(fl[0], getline(1))
93
94 call delete(fname)
95 endfunc
96
97 func Test_autoread_fast()
98 CheckFeature nanotime
99
100 new Xautoread
101 set autoread
102 call setline(1, 'foo')
103
104 w!
105 silent !echo bar > Xautoread
106 checktime
107
108 call assert_equal('bar', trim(getline(1)))
109 call delete('Xautoread')
77 endfunc 110 endfunc
78 111
79 func Test_autoread_file_deleted() 112 func Test_autoread_file_deleted()
80 new Xautoread 113 new Xautoread
81 set autoread 114 set autoread