nim-chronos/tests
Jacek Sieka f56d286687
introduce `asyncraises` to core future utilities (#454)
* introduce `asyncraises` to core future utilities

Similar to the introduction of `raises` into a codebase, `asyncraises`
needs to be introduced gradually across all functionality before
deriving benefit.

This is a first introduction along with utilities to manage raises lists
and transform them at compile time.

Several scenarios ensue:

* for trivial cases, adding `asyncraises` is enough and the framework
deduces the rest
* some functions "add" new asyncraises (similar to what `raise` does in
"normal" code) - for example `wait` may raise all exceptions of the
future passed to it and additionally a few of its own - this requires
extending the raises list
* som functions "remove" raises (similar to what `try/except` does) such
as `nocancel` with blocks cancellations and therefore reduce the raising
set

Both of the above cases are currently handled by a macro, but depending
on the situation lead to code organisation issues around return types
and pragma limitations - in particular, to keep `asyncraises`
backwards-compatibility, some code needs to exist in two versions which
somewhat complicates the implementation.

* add `asyncraises` versions for several `asyncfutures` utilities
* when assigning exceptions to a `Future` via `fail`, check at compile
time if possible and at runtime if not that the exception matches
constraints
* fix `waitFor` comments
* move async raises to separate module, implement `or`
2023-10-24 16:21:07 +02:00
..
config.nims Add nimRawSetjmp define to config.nims (#285) 2022-06-14 01:02:33 +03:00
testaddress.nim Compile-time configuration (#371) 2023-03-31 07:35:04 +02:00
testall.nim Recover `poll` engine and add tests. (#421) 2023-08-01 12:56:08 +03:00
testasyncstream.c move test data to c file (#448) 2023-10-17 14:19:20 +02:00
testasyncstream.nim move test data to c file (#448) 2023-10-17 14:19:20 +02:00
testbugs.nim Cancellation fixes and tests. (#445) 2023-09-15 19:38:39 +03:00
testdatagram.nim Trackers refactoring. (#416) 2023-07-14 13:35:08 +03:00
testfut.nim Raise tracking (#251) 2023-10-17 14:18:14 +02:00
testfutures.nim Introduce `chronos/futures` (#405) 2023-06-07 20:04:07 +02:00
testhttpclient.nim Cancellation fixes and tests. (#445) 2023-09-15 19:38:39 +03:00
testhttpserver.nim Cancellation fixes and tests. (#445) 2023-09-15 19:38:39 +03:00
testmacro.nim introduce `asyncraises` to core future utilities (#454) 2023-10-24 16:21:07 +02:00
testnet.nim exception warning fixes (#403) 2023-06-05 13:03:38 +02:00
testproc.bat Add some helpers for asyncproc. (#424) 2023-07-28 11:54:53 +03:00
testproc.nim Recover `poll` engine and add tests. (#421) 2023-08-01 12:56:08 +03:00
testproc.sh Add some helpers for asyncproc. (#424) 2023-07-28 11:54:53 +03:00
testratelimit.nim Cancellation fixes and tests. (#445) 2023-09-15 19:38:39 +03:00
testserver.nim add connect cancellation test (#444) 2023-09-05 13:41:52 +03:00
testshttpserver.nim Unroll `defer`s and remove `break`s. (#440) 2023-08-09 10:57:49 +03:00
testsignal.nim Add facility to emulate signals on Windows. (#357) 2023-06-02 01:53:20 +03:00
testsoon.nim Cancellation fixes and tests. (#445) 2023-09-15 19:38:39 +03:00
teststream.nim Cancellation fixes and tests. (#445) 2023-09-15 19:38:39 +03:00
testsync.nim Cancellation fixes and tests. (#445) 2023-09-15 19:38:39 +03:00
testthreadsync.nim Asynchronous thread notification mechanism. (#406) 2023-07-21 15:51:36 +03:00
testtime.nim Cancellation fixes and tests. (#445) 2023-09-15 19:38:39 +03:00
testutils.nim Cancellation fixes and tests. (#445) 2023-09-15 19:38:39 +03:00