Attribute Macro test

#[test]
Expand description

Declares a function as a test with access to the newly initialized Kanzi test runtime.

The signature of the test function must accept Domain and Screen as its only two arguments.

The return value can be the same as in the default #[test] macro (Box<dyn std::error::Error> or ()); however, kanzi::Result<()> is the most commonly used return type.

For example:

#[kanzi::test]
fn test(_domain: kanzi::Domain, screen: kanzi::Screen) -> kanzi::Result<()> {
    let is_visible = screen.get_visible()?;
    screen.set_visible(!is_visible)?;
    assert_eq!(screen.get_visible()?, !is_visible);

    Ok(())
}