pub struct Assertion {
pub assertion_type: String,
pub field: Option<String>,
pub value: Option<Value>,
pub values: Option<Vec<Value>>,
pub method: Option<String>,
pub check: Option<String>,
pub args: Option<Value>,
pub return_type: Option<String>,
}Expand description
A single assertion in a fixture.
Fields§
§assertion_type: StringAssertion type (equals, contains, not_empty, error, etc.).
field: Option<String>Field path to access on the result (dot-separated).
value: Option<Value>Expected value (string, number, bool, or array depending on type).
values: Option<Vec<Value>>Expected values (for contains_all, contains_any).
method: Option<String>Method name to call on the result (for method_result assertions).
check: Option<String>Assertion check type for the method result (equals, is_true, is_false, greater_than_or_equal, count_min).
args: Option<Value>Arguments to pass to the method call (for method_result assertions).
return_type: Option<String>Return type hint for C method_result codegen.
Supported values:
"string"— the method returns a heap-allocatedchar*that must be freed withfree()after the assertion. The generator emitschar* _r = call(); assert(...); free(_r);.
Defaults to primitive integer dispatch when absent.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Assertion
impl<'de> Deserialize<'de> for Assertion
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Assertion
impl RefUnwindSafe for Assertion
impl Send for Assertion
impl Sync for Assertion
impl Unpin for Assertion
impl UnsafeUnpin for Assertion
impl UnwindSafe for Assertion
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