Skip to main content

test

Attribute Macro test 

#[test]
Expand description

Enables an async test function.

The body of the async function runs on the runtime’s block_on; with threads = N the test builds its own runtime with N worker threads, where 0 runs everything on the block_on thread.

§Examples

#[nuclei::test]
async fn adds_up() -> std::io::Result<()> {
    assert_eq!(2 + 2, 4);
    Ok(())
}