pub struct TestResult { /* private fields */ }Expand description
A structure of test result.
The test result can be a success or a failure. A test error with a stack trace is in the result test if the test result is failure. Also, data from the standard output and the standard error stores in cursors which are in the test result.
Implementations§
Source§impl TestResult
impl TestResult
Sourcepub fn new(
error_pair: Option<(Error, Vec<(Option<Value>, Pos)>)>,
stdout: Option<Arc<RwLock<Cursor<Vec<u8>>>>>,
stderr: Option<Arc<RwLock<Cursor<Vec<u8>>>>>,
) -> TestResult
pub fn new( error_pair: Option<(Error, Vec<(Option<Value>, Pos)>)>, stdout: Option<Arc<RwLock<Cursor<Vec<u8>>>>>, stderr: Option<Arc<RwLock<Cursor<Vec<u8>>>>>, ) -> TestResult
Creates a test result.
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Returns true if the test result is success, otherwise false.
Sourcepub fn is_failure(&self) -> bool
pub fn is_failure(&self) -> bool
Returns true if the test result is failure, otherwise false.
Sourcepub fn error_pair(&self) -> Option<&(Error, Vec<(Option<Value>, Pos)>)>
pub fn error_pair(&self) -> Option<&(Error, Vec<(Option<Value>, Pos)>)>
Returns the test error with the stack trace if the test result is failure, otherwise
None.
Sourcepub fn stdout(&self) -> Option<&Arc<RwLock<Cursor<Vec<u8>>>>>
pub fn stdout(&self) -> Option<&Arc<RwLock<Cursor<Vec<u8>>>>>
Returns the cursor of standard output if the test result has the cursor of standard
output, otherwise None.
Sourcepub fn stderr(&self) -> Option<&Arc<RwLock<Cursor<Vec<u8>>>>>
pub fn stderr(&self) -> Option<&Arc<RwLock<Cursor<Vec<u8>>>>>
Returns the cursor of standard error if the test result has the cursor of standard error,
otherwise None.
Sourcepub fn has_stdout_data(&self) -> Result<bool>
pub fn has_stdout_data(&self) -> Result<bool>
Returns true if the test result has data from the standard output, otherwise false.
Sourcepub fn has_stderr_data(&self) -> Result<bool>
pub fn has_stderr_data(&self) -> Result<bool>
Returns true if the test result has data from the standard error, otherwise false.
Auto Trait Implementations§
impl !RefUnwindSafe for TestResult
impl !Send for TestResult
impl !Sync for TestResult
impl !UnwindSafe for TestResult
impl Freeze for TestResult
impl Unpin for TestResult
impl UnsafeUnpin for TestResult
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.