pub enum ShouldPanic {
No,
Yes,
YesWithMessage(&'static str),
}Expand description
Whether a test is expected to panic.
The easiest way to define a test that should panic is to use the #[should_panic] attribute
when defining the test.
#[cfg(test)]
mod tests {
use gba_test_macros::test;
#[test]
#[should_panic]
fn ignored_test() {
panic!("something was expected to go wrong");
}
}Variants§
No
The test is expected to run successfully.
Yes
The test is expected to panic during execution.
YesWithMessage(&'static str)
The test is expected to panic with the given substring present in the panic message.
Trait Implementations§
Source§impl Clone for ShouldPanic
impl Clone for ShouldPanic
Source§fn clone(&self) -> ShouldPanic
fn clone(&self) -> ShouldPanic
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ShouldPanic
Auto Trait Implementations§
impl Freeze for ShouldPanic
impl RefUnwindSafe for ShouldPanic
impl Send for ShouldPanic
impl Sync for ShouldPanic
impl Unpin for ShouldPanic
impl UnsafeUnpin for ShouldPanic
impl UnwindSafe for ShouldPanic
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