pub struct TestDsl<H> { /* private fields */ }
Expand description
The main type of the crate
It contains all available verbs and conditions, and is used to derive
TestCase
s.
Implementations§
Source§impl<H: 'static> TestDsl<H>
impl<H: 'static> TestDsl<H>
Sourcepub fn add_verb(&mut self, name: impl AsRef<str>, verb: impl Verb<H>)
pub fn add_verb(&mut self, name: impl AsRef<str>, verb: impl Verb<H>)
Add a single verb
The name is used as-is in your testcases, the arguments are up to each individual Verb
implementation.
See FunctionVerb
for an easy to use way of defining verbs.
Sourcepub fn add_condition(
&mut self,
name: impl AsRef<str>,
condition: impl Condition<H>,
)
pub fn add_condition( &mut self, name: impl AsRef<str>, condition: impl Condition<H>, )
Add a single condition
The name is used as-is in your testcases, the arguments are up to each individual
Condition
implementation.
See FunctionCondition
for an easy to use way of defining conditions.
Sourcepub fn parse_testcase(
&self,
input: impl Into<TestCaseInput>,
) -> Result<Vec<TestCase<H>>, TestParseError>
pub fn parse_testcase( &self, input: impl Into<TestCaseInput>, ) -> Result<Vec<TestCase<H>>, TestParseError>
Parse a given document as a KdlDocument
and generate a
TestCase
out of it.
Trait Implementations§
Auto Trait Implementations§
impl<H> Freeze for TestDsl<H>
impl<H> !RefUnwindSafe for TestDsl<H>
impl<H> !Send for TestDsl<H>
impl<H> !Sync for TestDsl<H>
impl<H> Unpin for TestDsl<H>
impl<H> !UnwindSafe for TestDsl<H>
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