aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-04-06 05:58:28 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-04-06 05:58:55 +0800
commitf4a0c853db8ee3c797c108da9d9d48e697f10667 (patch)
treeb9c137cf9530dad0baca97d612a3c135799b660b
parentdcf4c5744a9ad68e9cfe001b39706f914ba4c9da (diff)
downloadrneovim-f4a0c853db8ee3c797c108da9d9d48e697f10667.tar.gz
rneovim-f4a0c853db8ee3c797c108da9d9d48e697f10667.tar.bz2
rneovim-f4a0c853db8ee3c797c108da9d9d48e697f10667.zip
vim-patch:9.1.0268: Two tests in test_filechanged.vim are slow
Problem: Two tests in test_filechanged.vim are slow. Solution: Sleep for shorter if the +nanotime feature is available. (zeertzjq) closes: vim/vim#14418 https://github.com/vim/vim/commit/83cd2c7bf0c12f05d747dd5fd6abfe103948bf12
-rw-r--r--test/old/testdir/test_filechanged.vim34
1 files changed, 27 insertions, 7 deletions
diff --git a/test/old/testdir/test_filechanged.vim b/test/old/testdir/test_filechanged.vim
index b9f8d4c37a..a8fc78ff90 100644
--- a/test/old/testdir/test_filechanged.vim
+++ b/test/old/testdir/test_filechanged.vim
@@ -11,8 +11,12 @@ func Test_FileChangedShell_reload()
new Xchanged_r
call setline(1, 'reload this')
write
- " Need to wait until the timestamp would change by at least a second.
- sleep 2
+ " Need to wait until the timestamp would change.
+ if has('nanotime')
+ sleep 10m
+ else
+ sleep 2
+ endif
silent !echo 'extra line' >>Xchanged_r
checktime
call assert_equal('changed', g:reason)
@@ -50,7 +54,11 @@ func Test_FileChangedShell_reload()
call assert_equal('new line', getline(1))
" Only time changed
- sleep 2
+ if has('nanotime')
+ sleep 10m
+ else
+ sleep 2
+ endif
silent !touch Xchanged_r
let g:reason = ''
checktime
@@ -65,7 +73,11 @@ func Test_FileChangedShell_reload()
call setline(2, 'before write')
write
call setline(2, 'after write')
- sleep 2
+ if has('nanotime')
+ sleep 10m
+ else
+ sleep 2
+ endif
silent !echo 'different line' >>Xchanged_r
let g:reason = ''
checktime
@@ -198,8 +210,12 @@ func Test_file_changed_dialog()
new Xchanged_d
call setline(1, 'reload this')
write
- " Need to wait until the timestamp would change by at least a second.
- sleep 2
+ " Need to wait until the timestamp would change.
+ if has('nanotime')
+ sleep 10m
+ else
+ sleep 2
+ endif
silent !echo 'extra line' >>Xchanged_d
call feedkeys('L', 'L')
checktime
@@ -234,7 +250,11 @@ func Test_file_changed_dialog()
call assert_equal('new line', getline(1))
" Only time changed, no prompt
- sleep 2
+ if has('nanotime')
+ sleep 10m
+ else
+ sleep 2
+ endif
silent !touch Xchanged_d
let v:warningmsg = ''
checktime Xchanged_d