pub struct Case<Inputs, Output = (), Metadata = ()> {
pub name: Option<String>,
pub inputs: Inputs,
pub expected_output: Option<Output>,
pub metadata: Option<Metadata>,
pub tags: Vec<String>,
}Available on crate feature
evals only.Expand description
A single evaluation test case.
Fields§
§name: Option<String>Test case name.
inputs: InputsInputs to the task.
expected_output: Option<Output>Expected output (if known).
metadata: Option<Metadata>Metadata for evaluators.
Tags for filtering.
Implementations§
Source§impl<Inputs, Output, Metadata> Case<Inputs, Output, Metadata>
impl<Inputs, Output, Metadata> Case<Inputs, Output, Metadata>
Sourcepub fn with_name(
self,
name: impl Into<String>,
) -> Case<Inputs, Output, Metadata>
pub fn with_name( self, name: impl Into<String>, ) -> Case<Inputs, Output, Metadata>
Set the case name.
Sourcepub fn with_expected_output(
self,
output: Output,
) -> Case<Inputs, Output, Metadata>
pub fn with_expected_output( self, output: Output, ) -> Case<Inputs, Output, Metadata>
Set the expected output.
Sourcepub fn with_metadata(self, metadata: Metadata) -> Case<Inputs, Output, Metadata>
pub fn with_metadata(self, metadata: Metadata) -> Case<Inputs, Output, Metadata>
Set the metadata.
Add multiple tags.
Sourcepub fn display_name(&self, index: usize) -> String
pub fn display_name(&self, index: usize) -> String
Get the display name.
Trait Implementations§
Auto Trait Implementations§
impl<Inputs, Output, Metadata> Freeze for Case<Inputs, Output, Metadata>
impl<Inputs, Output, Metadata> RefUnwindSafe for Case<Inputs, Output, Metadata>
impl<Inputs, Output, Metadata> Send for Case<Inputs, Output, Metadata>
impl<Inputs, Output, Metadata> Sync for Case<Inputs, Output, Metadata>
impl<Inputs, Output, Metadata> Unpin for Case<Inputs, Output, Metadata>
impl<Inputs, Output, Metadata> UnwindSafe for Case<Inputs, Output, Metadata>
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