pub struct ExplicitTestCase { /* private fields */ }Expand description
A test case with pre-defined values for explicit/example-based testing.
Created by #[hegel::explicit_test_case]. Values are looked up by name
when draw or __draw_named is called, instead of being generated by
the server.
§Threading
Unlike TestCase, ExplicitTestCase is neither Send
nor Sync and does not currently support being used from multiple
threads. A test body that clones tc and moves it into a spawned thread
therefore cannot be combined with #[hegel::explicit_test_case]: the
macro expands the body with tc: &ExplicitTestCase for the explicit run,
and &ExplicitTestCase will not pass std::thread::spawn’s Send bound.
Implementations§
Source§impl ExplicitTestCase
impl ExplicitTestCase
pub fn draw<T: Debug + 'static>(&self, generator: impl Generator<T>) -> T
pub fn __draw_named<T: Debug + 'static>( &self, _generator: impl Generator<T>, name: &str, _repeatable: bool, ) -> T
pub fn draw_silent<T>(&self, _generator: impl Generator<T>) -> T
pub fn note(&self, message: &str)
pub fn assume(&self, condition: bool)
pub fn reject(&self) -> !
Auto Trait Implementations§
impl !Freeze for ExplicitTestCase
impl !RefUnwindSafe for ExplicitTestCase
impl !Send for ExplicitTestCase
impl !Sync for ExplicitTestCase
impl Unpin for ExplicitTestCase
impl UnsafeUnpin for ExplicitTestCase
impl !UnwindSafe for ExplicitTestCase
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