pub struct AssertionSet {
pub rules: Vec<AssertionRule>,
}Expand description
Declarative JSON assertion DSL container.
Runs also apply default assertions that fail on MCP protocol errors, schema-invalid responses, and (when configured) tool result error responses.
Example:
use serde_json::json;
use tooltest_core::{
AssertionCheck, AssertionRule, AssertionSet, AssertionTarget, ResponseAssertion,
};
let assertions = AssertionSet {
rules: vec![AssertionRule::Response(ResponseAssertion {
tool: Some("echo".to_string()),
checks: vec![AssertionCheck {
target: AssertionTarget::StructuredOutput,
pointer: "/status".to_string(),
expected: json!("ok"),
}],
})],
};Fields§
§rules: Vec<AssertionRule>Assertion rules evaluated during or after a run.
Trait Implementations§
Source§impl Clone for AssertionSet
impl Clone for AssertionSet
Source§fn clone(&self) -> AssertionSet
fn clone(&self) -> AssertionSet
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AssertionSet
impl Debug for AssertionSet
Source§impl Default for AssertionSet
impl Default for AssertionSet
Source§fn default() -> AssertionSet
fn default() -> AssertionSet
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AssertionSet
impl<'de> Deserialize<'de> for AssertionSet
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 AssertionSet
impl RefUnwindSafe for AssertionSet
impl Send for AssertionSet
impl Sync for AssertionSet
impl Unpin for AssertionSet
impl UnwindSafe for AssertionSet
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