pub struct GeneratedTestCase {
pub name: String,
pub equation_id: String,
pub inputs: IndexMap<String, f64>,
pub expected_output: f64,
pub assertion: String,
pub source_step_id: u64,
pub tolerance: f64,
}Expand description
Test case generated from audit log.
Fields§
§name: StringTest case name
equation_id: StringEquation being tested
inputs: IndexMap<String, f64>Input values
expected_output: f64Expected output
assertion: StringAssertion description
source_step_id: u64Source step ID
tolerance: f64Tolerance for floating-point comparison
Implementations§
Source§impl GeneratedTestCase
impl GeneratedTestCase
Sourcepub fn new(
name: impl Into<String>,
equation_id: impl Into<String>,
expected_output: f64,
source_step_id: u64,
) -> Self
pub fn new( name: impl Into<String>, equation_id: impl Into<String>, expected_output: f64, source_step_id: u64, ) -> Self
Create a new generated test case.
Sourcepub fn with_input(self, name: impl Into<String>, value: f64) -> Self
pub fn with_input(self, name: impl Into<String>, value: f64) -> Self
Add input.
Sourcepub fn with_assertion(self, assertion: impl Into<String>) -> Self
pub fn with_assertion(self, assertion: impl Into<String>) -> Self
Set assertion.
Sourcepub fn with_tolerance(self, tolerance: f64) -> Self
pub fn with_tolerance(self, tolerance: f64) -> Self
Set tolerance.
Sourcepub fn to_rust_test(&self) -> String
pub fn to_rust_test(&self) -> String
Generate Rust test code.
Trait Implementations§
Source§impl Clone for GeneratedTestCase
impl Clone for GeneratedTestCase
Source§fn clone(&self) -> GeneratedTestCase
fn clone(&self) -> GeneratedTestCase
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 GeneratedTestCase
impl Debug for GeneratedTestCase
Source§impl<'de> Deserialize<'de> for GeneratedTestCase
impl<'de> Deserialize<'de> for GeneratedTestCase
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 GeneratedTestCase
impl RefUnwindSafe for GeneratedTestCase
impl Send for GeneratedTestCase
impl Sync for GeneratedTestCase
impl Unpin for GeneratedTestCase
impl UnsafeUnpin for GeneratedTestCase
impl UnwindSafe for GeneratedTestCase
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