pub struct TestError { /* private fields */ }Expand description
Test failure value — defined in rustdv-methodology since step 4, because
Component::run returns it and the UVM crate sits below this one
(D46/D47). Re-exported so ::rustdv::TestError is unchanged.
Implementations§
Source§impl TestError
impl TestError
Sourcepub fn new(msg: impl Into<String>) -> TestError
pub fn new(msg: impl Into<String>) -> TestError
An unclassified failure — the common case for a check that failed.
Sourcepub fn with_kind(msg: impl Into<String>, kind: &'static str) -> TestError
pub fn with_kind(msg: impl Into<String>, kind: &'static str) -> TestError
A failure with a cause the runner can match against expect_error.
Kinds are stable strings; see crate::config::ConfigError::kind.
pub fn message(&self) -> &str
Trait Implementations§
Source§impl Error for TestError
impl Error for TestError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<ConfigError> for TestError
Configuration failures keep their cause, so ? in a test body still
lets expect_error distinguish “nothing was set” from “wrong type”.
impl From<ConfigError> for TestError
Configuration failures keep their cause, so ? in a test body still
lets expect_error distinguish “nothing was set” from “wrong type”.
Source§fn from(e: ConfigError) -> TestError
fn from(e: ConfigError) -> TestError
Converts to this type from the input type.
Source§impl From<HandleError> for TestError
impl From<HandleError> for TestError
Source§fn from(e: HandleError) -> TestError
fn from(e: HandleError) -> TestError
Converts to this type from the input type.
Source§impl From<ValueError> for TestError
impl From<ValueError> for TestError
Source§fn from(e: ValueError) -> TestError
fn from(e: ValueError) -> TestError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TestError
impl RefUnwindSafe for TestError
impl Send for TestError
impl Sync for TestError
impl Unpin for TestError
impl UnsafeUnpin for TestError
impl UnwindSafe for TestError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more