Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions test/Async/Promise.vimspec
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
function! s:wait_has_key(obj, name) abort
return s:wait_has_key_with_timeout(a:obj, a:name, 5)
endfunction

function! s:wait_has_key_with_timeout(obj, name, timeout_sec) abort
let timeout_sec = 5
let i = 0
while i < a:timeout_sec * 100
while i < timeout_sec * 100
sleep 10m
if has_key(a:obj, a:name)
return
endif
let i += 1
endwhile
throw printf("s:wait_has_key(): After %ds, the given object does not have key '%s': %s", a:timeout_sec, a:name, a:obj)
throw printf("s:wait_has_key(): After %ds, the given object does not have key '%s': %s", timeout_sec, a:name, a:obj)
endfunction

function! s:resolver(resolve, reject) abort
Expand Down