Initial commit
This commit is contained in:
commit
2f39c58d6c
27 changed files with 2969 additions and 0 deletions
20
tests/promise.scm
Normal file
20
tests/promise.scm
Normal file
|
@ -0,0 +1,20 @@
|
|||
(use-modules (tests)
|
||||
(fibers)
|
||||
(unit-test)
|
||||
(knots parallelism)
|
||||
(knots promise))
|
||||
|
||||
(run-fibers-for-tests
|
||||
(lambda ()
|
||||
(let ((promises
|
||||
(map (lambda (i)
|
||||
(fibers-delay
|
||||
(lambda ()
|
||||
(* i 2))))
|
||||
(iota 10))))
|
||||
|
||||
(assert-equal
|
||||
90
|
||||
(apply + (fibers-map fibers-force promises))))))
|
||||
|
||||
(display "promise test finished successfully\n")
|
Loading…
Add table
Add a link
Reference in a new issue