pub struct TestCase {
pub name: String,
pub skill: PathBuf,
pub input: String,
pub user: Option<SimulatedUser>,
pub mocks: Vec<MockDecl>,
pub spy: bool,
pub evals: Vec<Eval>,
}Expand description
One test case.
Fields§
§name: StringHuman-readable name (defaults to the file stem when loaded from a file).
skill: PathBufPath to the skill directory under test, relative to the test-case file.
input: StringThe initial data/prompt handed to the skill as the first user message.
user: Option<SimulatedUser>Present for multi-turn cases; absent for single-turn.
mocks: Vec<MockDecl>Mock/spy declarations for this case: a declaration with a stub/deny/
rewrite action intercepts matching tool calls; one without observes
only. called/not_called evals reference these by name.
spy: boolRecord every tool call through the mock/spy channel even with no
mocks declared, so code-level consumers (the SDKs’ spies) get records.
Implied whenever mocks is non-empty.
evals: Vec<Eval>The evals that decide whether this case passes. Must be non-empty.
Implementations§
Source§impl TestCase
impl TestCase
Sourcepub fn load(path: &Path) -> Result<Self>
pub fn load(path: &Path) -> Result<Self>
Load a test case from a YAML file. The name defaults to the file stem
and skill is resolved relative to the file’s directory.
§Errors
Error::Io if the file cannot be read, Error::Yaml on parse
failure, and Error::Invalid if the case is internally inconsistent.
Sourcepub fn is_multi_turn(&self) -> bool
pub fn is_multi_turn(&self) -> bool
Whether this is a multi-turn case (has a simulated user).