ExtelResult

Type Alias ExtelResult 

Source
pub type ExtelResult = Result<(), Error>;
Expand description

The expected return type of extel test functions. This type is represented as a result type to allow error propogation.

§Example

use extel::{pass, fail, ExtelResult};

fn always_succeed() -> ExtelResult {
    pass!()
}

fn always_fail() -> ExtelResult {
    fail!("failed")
}

fn early_fail_from_err() -> ExtelResult {
    let invalid_utf8 = *b"\xE0\x80\x80";
    let _ = String::from_utf8(invalid_utf8.into())?;
    pass!()
}

assert!(
    always_succeed().is_ok() &&
    always_fail().is_err() &&
    early_fail_from_err().is_err()
);

Aliased Type§

pub enum ExtelResult {
    Ok(()),
    Err(Error),
}

Variants§

§1.0.0

Ok(())

Contains the success value

§1.0.0

Err(Error)

Contains the error value

Trait Implementations§