Skip to content

Commit b8641ed

Browse files
authored
Merge pull request #714 from vim-jp/refactor-async-promise-test
Async.Promise: Remove test helper wait_has_key_with_timeout
2 parents 673972d + 7f6609b commit b8641ed

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

test/Async/Promise.vimspec

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
function! s:wait_has_key(obj, name) abort
2-
return s:wait_has_key_with_timeout(a:obj, a:name, 5)
3-
endfunction
4-
5-
function! s:wait_has_key_with_timeout(obj, name, timeout_sec) abort
2+
let timeout_sec = 5
63
let i = 0
7-
while i < a:timeout_sec * 100
4+
while i < timeout_sec * 100
85
sleep 10m
96
if has_key(a:obj, a:name)
107
return
118
endif
129
let i += 1
1310
endwhile
14-
throw printf("s:wait_has_key(): After %ds, the given object does not have key '%s': %s", a:timeout_sec, a:name, a:obj)
11+
throw printf("s:wait_has_key(): After %ds, the given object does not have key '%s': %s", timeout_sec, a:name, a:obj)
1512
endfunction
1613

1714
function! s:resolver(resolve, reject) abort

0 commit comments

Comments
 (0)