pub struct OcamlTestCase {
pub name: String,
pub body: String,
pub expected: Option<String>,
pub actual: Option<String>,
}Expand description
An OUnit2-style test case.
Fields§
§name: StringTest name.
body: StringTest body code.
expected: Option<String>Expected result (for assert_equal).
actual: Option<String>Actual expression to evaluate.
Implementations§
Source§impl OcamlTestCase
impl OcamlTestCase
Sourcepub fn assert_equal(name: &str, expected: &str, actual: &str) -> Self
pub fn assert_equal(name: &str, expected: &str, actual: &str) -> Self
Create an equality assertion test.
Sourcepub fn emit_ounit(&self) -> String
pub fn emit_ounit(&self) -> String
Emit as an OUnit2 test case.
Sourcepub fn emit_alcotest(&self, test_type: &str) -> String
pub fn emit_alcotest(&self, test_type: &str) -> String
Emit as an inline Alcotest test.
Trait Implementations§
Source§impl Clone for OcamlTestCase
impl Clone for OcamlTestCase
Source§fn clone(&self) -> OcamlTestCase
fn clone(&self) -> OcamlTestCase
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 moreAuto Trait Implementations§
impl Freeze for OcamlTestCase
impl RefUnwindSafe for OcamlTestCase
impl Send for OcamlTestCase
impl Sync for OcamlTestCase
impl Unpin for OcamlTestCase
impl UnsafeUnpin for OcamlTestCase
impl UnwindSafe for OcamlTestCase
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