Mercurial > vim
comparison src/testdir/shared.vim @ 19249:2a017e9dc6da v8.2.0183
patch 8.2.0183: tests fail when the float feature is disabled
Commit: https://github.com/vim/vim/commit/5feabe00c47fa66d5f4c95213f150488433f78e3
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jan 30 18:24:53 2020 +0100
patch 8.2.0183: tests fail when the float feature is disabled
Problem: Tests fail when the float feature is disabled.
Solution: Skip tests that don't work without float support.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 30 Jan 2020 18:30:04 +0100 |
parents | eff8d8f72a82 |
children | 031184ace7c5 |
comparison
equal
deleted
inserted
replaced
19248:5e803caf5e9c | 19249:2a017e9dc6da |
---|---|
154 " Either "expr" or "assert" is not v:null | 154 " Either "expr" or "assert" is not v:null |
155 " Return the waiting time for success, -1 for failure. | 155 " Return the waiting time for success, -1 for failure. |
156 func s:WaitForCommon(expr, assert, timeout) | 156 func s:WaitForCommon(expr, assert, timeout) |
157 " using reltime() is more accurate, but not always available | 157 " using reltime() is more accurate, but not always available |
158 let slept = 0 | 158 let slept = 0 |
159 if has('reltime') | 159 if exists('*reltimefloat') |
160 let start = reltime() | 160 let start = reltime() |
161 endif | 161 endif |
162 | 162 |
163 while 1 | 163 while 1 |
164 if type(a:expr) == v:t_func | 164 if type(a:expr) == v:t_func |
179 " Remove the error added by the assert function. | 179 " Remove the error added by the assert function. |
180 call remove(v:errors, -1) | 180 call remove(v:errors, -1) |
181 endif | 181 endif |
182 | 182 |
183 sleep 10m | 183 sleep 10m |
184 if has('reltime') | 184 if exists('*reltimefloat') |
185 let slept = float2nr(reltimefloat(reltime(start)) * 1000) | 185 let slept = float2nr(reltimefloat(reltime(start)) * 1000) |
186 else | 186 else |
187 let slept += 10 | 187 let slept += 10 |
188 endif | 188 endif |
189 endwhile | 189 endwhile |
195 " Wait for up to a given milliseconds. | 195 " Wait for up to a given milliseconds. |
196 " With the +timers feature this waits for key-input by getchar(), Resume() | 196 " With the +timers feature this waits for key-input by getchar(), Resume() |
197 " feeds key-input and resumes process. Return time waited in milliseconds. | 197 " feeds key-input and resumes process. Return time waited in milliseconds. |
198 " Without +timers it uses simply :sleep. | 198 " Without +timers it uses simply :sleep. |
199 func Standby(msec) | 199 func Standby(msec) |
200 if has('timers') | 200 if has('timers') && exists('*reltimefloat') |
201 let start = reltime() | 201 let start = reltime() |
202 let g:_standby_timer = timer_start(a:msec, function('s:feedkeys')) | 202 let g:_standby_timer = timer_start(a:msec, function('s:feedkeys')) |
203 call getchar() | 203 call getchar() |
204 return float2nr(reltimefloat(reltime(start)) * 1000) | 204 return float2nr(reltimefloat(reltime(start)) * 1000) |
205 else | 205 else |