Skip to main content

TestResultExt

Trait TestResultExt 

Source
pub trait TestResultExt: Sized {
    // Required methods
    fn expect_value_eq<T: IntoValue>(self, value: T) -> Result;
    fn expect_shell_error(self) -> Result<ShellError>;
    fn expect_parse_error(self) -> Result<ParseError>;
    fn expect_compile_error(self) -> Result<CompileError>;
    fn expect_io_error(self) -> Result<IoError>;
    fn expect_network_error(self) -> Result<NetworkError>;
    fn expect_labeled_error(self) -> Result<LabeledError>;

    // Provided method
    fn expect_error(self) -> Result<ShellError> { ... }
}
Expand description

Extensions for asserting error kinds from test helpers.

Required Methods§

Source

fn expect_value_eq<T: IntoValue>(self, value: T) -> Result

Expect the result to be a Value equal to the provided input.

Source

fn expect_shell_error(self) -> Result<ShellError>

Expect the result to be a ShellError.

Source

fn expect_parse_error(self) -> Result<ParseError>

Expect the result to be a ParseError.

Source

fn expect_compile_error(self) -> Result<CompileError>

Expect the result to be a CompileError.

Source

fn expect_io_error(self) -> Result<IoError>

Expect the result to be a ShellError::Io.

Source

fn expect_network_error(self) -> Result<NetworkError>

Expect the result to be a ShellError::Network.

Source

fn expect_labeled_error(self) -> Result<LabeledError>

Expect the result to be a ShellError::LabeledError.

Provided Methods§

Source

fn expect_error(self) -> Result<ShellError>

Expect the result to be a ShellError.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§