safina-async-test

A macro for running async fn
tests.
It is part of safina
, a safe async runtime.
Runs tests with safina_executor::block_on
.
Features
forbid(unsafe_code)
- Straightforward implementation
Limitations
- Requires Rust
nightly
because safina-executor does
Examples
```rust
use safinaasynctest::async_test;
[async_test]
async fn test1() {
anasyncfn().await.unwrap();
}
```
```rust
use safinaasynctest::async_test;
[async_test]
async fn test2() {
safinaexecutor::increasethreadsto(1);
safinaexecutor::spawn(backgroundtask());
asserteq!(42, do_request().await.unwrap());
}
```
Documentation
https://docs.rs/safina-async-test
Alternatives
Changelog
- v0.1.4 - Upgrade to new safina-executor version which removes need for
Box::pin
.
- v0.1.3 - Add badges to readme. Rename
safina
package to safina-executor
.
- v0.1.2 - Update docs
- v0.1.1 - First published version
TO DO
- DONE - Implement as declarative macro. UX is bad.
- DONE - Implement as procedural macro.
- DONE - Report errors nicely
- DONE - Publish on crates.io
- Let users depend only on safina-async-test:
- Move proc macro to its own crate.
- Make safinaasynctest re-export the macro and safinaexecutor::blockon.
- Change the macro to call safinaasynctest::block_on.
Release Process
- Edit
Cargo.toml
and bump version number.
- Run
./release.sh
License: Apache-2.0