Skip to content

Commit 673972d

Browse files
authored
Merge pull request #713 from vim-jp/fix-macvim
Fix Async.Promise tests for test stabiligy even with MacVim
2 parents 95a8d9c + 4609809 commit 673972d

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

.travis.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ jobs:
2020
env:
2121
- VIM_VERSION=master
2222
- THEMIS_PROFILE=vim-profile-master.txt
23-
# - name: Vim MacVim latest
24-
# os: osx
25-
# osx_image: xcode9.4
26-
# env:
27-
# - THEMIS_PROFILE=vim-profile-osx.txt
28-
# cache:
29-
# directories:
30-
# - $HOME/Library/Caches/Homebrew/
31-
# - /usr/local/Homebrew/Library/Homebrew/vendor/
32-
# - /usr/local/Homebrew/Library/Taps/
33-
# before_cache:
34-
# - brew cleanup
35-
# - name: Vim Lint only
36-
# os: linux
37-
# env:
38-
# - RUN_LINT=true
23+
- name: Vim MacVim latest
24+
os: osx
25+
osx_image: xcode9.4
26+
env:
27+
- THEMIS_PROFILE=vim-profile-osx.txt
28+
cache:
29+
directories:
30+
- $HOME/Library/Caches/Homebrew/
31+
- /usr/local/Homebrew/Library/Homebrew/vendor/
32+
- /usr/local/Homebrew/Library/Taps/
33+
before_cache:
34+
- brew cleanup
35+
- name: Vim Lint only
36+
os: linux
37+
env:
38+
- RUN_LINT=true
3939

4040
addons:
4141
apt:

test/Async/Promise.vimspec

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
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
26
let i = 0
3-
while i < 500
7+
while i < a:timeout_sec * 100
48
sleep 10m
59
if has_key(a:obj, a:name)
610
return
711
endif
812
let i += 1
913
endwhile
10-
throw printf("s:wait_has_key(): After 5000ms, the given object does not have key '%s': %s", a:name, a:obj)
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)
1115
endfunction
1216

1317
function! s:resolver(resolve, reject) abort
@@ -606,10 +610,10 @@ Describe Async.Promise
606610
\ P.resolve(P.resolve(P.resolve(P.resolve(42)))),
607611
\ P.resolve(Wait(10).then({-> 42}))
608612
\ ]
609-
Assert Equals(p._state, FULFILLED)
610613
let l = l:
611614
call p.then({x -> extend(l, {'result' : x})})
612615
call s:wait_has_key(l, 'result')
616+
Assert Equals(p._state, FULFILLED)
613617
Assert Equals(result, 42)
614618
unlet result
615619
endfor

0 commit comments

Comments
 (0)