Struct runt::executor::results::Test

source ·
pub struct Test {
    pub path: PathBuf,
    pub expect_path: PathBuf,
    pub state: State,
    pub saved: bool,
    pub test_suite: Id,
}
Expand description

Store information related to a test.

Fields§

§path: PathBuf

Path of the test

§expect_path: PathBuf

Location of the expect string.

§state: State

Result of comparison

§saved: bool

The results of this structure were saved.

§test_suite: Id

Id for the test suite that owns this test.

Implementations§

source§

impl Test

source

pub async fn save_results(&mut self) -> Result<(), RuntError>

Save the results of the test suite into the expect file.

source

pub fn should_save(&self, opts: &Opts) -> bool

Returns true if the current options require this test to be saved.

source

pub fn should_print(&self, opts: &Opts) -> bool

Returns true if this test should be printed with the current options.

source

pub fn report_str(&self, suite: Option<&String>, show_diff: bool) -> String

Generate colorized string to report the results of this test.

Trait Implementations§

source§

impl Debug for Test

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Test

§

impl Send for Test

§

impl Sync for Test

§

impl Unpin for Test

§

impl UnwindSafe for Test

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.