Initial commit
This commit is contained in:
commit
2f39c58d6c
27 changed files with 2969 additions and 0 deletions
22
tests/timeout.scm
Normal file
22
tests/timeout.scm
Normal file
|
@ -0,0 +1,22 @@
|
|||
(use-modules (tests)
|
||||
(fibers)
|
||||
(unit-test)
|
||||
(knots timeout))
|
||||
|
||||
(run-fibers-for-tests
|
||||
(lambda ()
|
||||
(assert-equal
|
||||
1
|
||||
(with-fibers-timeout
|
||||
(const 1)
|
||||
#:timeout 10))
|
||||
|
||||
(assert-equal
|
||||
2
|
||||
(with-fibers-timeout
|
||||
(lambda ()
|
||||
(sleep 10))
|
||||
#:timeout 0.1
|
||||
#:on-timeout (const 2)))))
|
||||
|
||||
(display "timeout test finished successfully\n")
|
Loading…
Add table
Add a link
Reference in a new issue