summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-04-05 20:05:11 +0200
committerChristian Brabandt <cb@256bit.org>2024-04-05 20:05:11 +0200
commit83cd2c7bf0c12f05d747dd5fd6abfe103948bf12 (patch)
tree7518177b7fe4875c16deb25247084889f0333e3f
parentc20bdf1107d48a1c14713709d12d429e761132af (diff)
patch 9.1.0268: Two tests in test_filechanged.vim are slowv9.1.0268
Problem: Two tests in test_filechanged.vim are slow. Solution: Sleep for shorter if the +nanotime feature is available. (zeertzjq) closes: #14418 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
-rw-r--r--src/testdir/test_filechanged.vim34
-rw-r--r--src/version.c2
2 files changed, 29 insertions, 7 deletions
diff --git a/src/testdir/test_filechanged.vim b/src/testdir/test_filechanged.vim
index c3a5664aed..12ac4ccde4 100644
--- a/src/testdir/test_filechanged.vim
+++ b/src/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
@@ -192,8 +204,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
@@ -228,7 +244,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
diff --git a/src/version.c b/src/version.c
index 5534b9b308..cf57e3862d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 268,
+/**/
267,
/**/
266,