Skip to content

Commit 5d00a5c

Browse files
committed
Async.Promise: Add testcase for &maxfuncdepth
1 parent d46ecd9 commit 5d00a5c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/Async/Promise.vimspec

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,18 @@ Describe Async.Promise
863863
Assert KeyNotExists(l, 'Goodbye')
864864
End
865865

866+
It sequentially calls functions in factories beyonds &maxfuncdepth and resolves promises
867+
let l = l:
868+
let fs = map(
869+
\ range(&maxfuncdepth * 2),
870+
\ { k -> { -> P.new({r -> r(k) }) } },
871+
\)
872+
let p = P.chain(fs).then({ v -> extend(l, { 'result': v })})
873+
call s:wait_has_key(l, 'result')
874+
Assert Equals(len(result), &maxfuncdepth * 2)
875+
Assert Equals(result, range(&maxfuncdepth * 2))
876+
Assert Equals(p._state, FULFILLED)
877+
End
866878
End
867879

868880
Describe .on_unhandled_rejection

0 commit comments

Comments
 (0)