Struct leetcode_rust::common::CaseGroup
source · pub struct CaseGroup<T, G, P> { /* private fields */ }
Expand description
A easy to use test case collection struct that also provide functions for simple test case creation.
Implementations§
source§impl<T, G, P> CaseGroup<T, G, P>
impl<T, G, P> CaseGroup<T, G, P>
source§impl<G, P> CaseGroup<String, G, P>where
P: PartialEq + Debug,
G: PartialEq + Debug,
impl<G, P> CaseGroup<String, G, P>where
P: PartialEq + Debug,
G: PartialEq + Debug,
Implement two handy methods on CaseGroup<String, G, P> struct.
sourcepub fn create(&mut self, ipt: &str, exp: Vec<G>)
pub fn create(&mut self, ipt: &str, exp: Vec<G>)
Create a new test case (no input parameters) matching &str and other generic types.
Argument
ipt
- this argument is set to&str
to simplify method calls.exp
- expected values inVec<G>
form.
sourcepub fn create_param(&mut self, ipt: &str, exp: Vec<G>, params: Vec<P>)
pub fn create_param(&mut self, ipt: &str, exp: Vec<G>, params: Vec<P>)
Create a new test case (with input parameters) matching &str and other generic types.
Argument
ipt
- this argument is set to&str
to simplify method calls.exp
- expected values inVec<G>
form.params
- expected values inVec<P>
form.
sourcepub fn create_multi(&mut self, ipts: Vec<&str>, exp: Vec<G>)
pub fn create_multi(&mut self, ipts: Vec<&str>, exp: Vec<G>)
Create a new test case (no input parameters but multiple inputs) matching &str and other generic types.
Argument
ipts
- this argument is set to&str
to simplify method calls.exp
- expected values inVec<G>
form.
sourcepub fn create_param_multi(&mut self, ipts: Vec<&str>, exp: Vec<G>, params: Vec<P>)
pub fn create_param_multi(&mut self, ipts: Vec<&str>, exp: Vec<G>, params: Vec<P>)
Create a new test case (with input parameters and multiple inputs) matching &str and other generic types.
Argument
ipts
- this argument is set to&str
to simplify method calls.exp
- expected values inVec<G>
form.params
- expected values inVec<P>
form.
source§impl CaseGroup<i32, i32, i32>
impl CaseGroup<i32, i32, i32>
Implement two handy methods on CaseGroup struct.
sourcepub fn create(&mut self, ipt: i32, exp: Vec<i32>)
pub fn create(&mut self, ipt: i32, exp: Vec<i32>)
Create a new test case (no input parameters) matching selected generic types.
sourcepub fn create_param(&mut self, ipt: i32, exp: Vec<i32>, params: Vec<i32>)
pub fn create_param(&mut self, ipt: i32, exp: Vec<i32>, params: Vec<i32>)
Create a new test case (with input parameters) matching selected generic types.
source§impl CaseGroup<i32, String, i32>
impl CaseGroup<i32, String, i32>
Implement two handy methods on CaseGroup struct.
sourcepub fn create(&mut self, ipt: i32, exp: Vec<String>)
pub fn create(&mut self, ipt: i32, exp: Vec<String>)
Create a new test case (no input parameters) matching selected generic types.
sourcepub fn create_param(&mut self, ipt: i32, exp: Vec<String>, params: Vec<i32>)
pub fn create_param(&mut self, ipt: i32, exp: Vec<String>, params: Vec<i32>)
Create a new test case (with input parameters) matching selected generic types.
source§impl CaseGroup<i32, bool, i32>
impl CaseGroup<i32, bool, i32>
Implement two handy methods on CaseGroup struct.
sourcepub fn create(&mut self, ipt: i32, exp: Vec<bool>)
pub fn create(&mut self, ipt: i32, exp: Vec<bool>)
Create a new test case (no input parameters) matching selected generic types.
sourcepub fn create_param(&mut self, ipt: i32, exp: Vec<bool>, params: Vec<i32>)
pub fn create_param(&mut self, ipt: i32, exp: Vec<bool>, params: Vec<i32>)
Create a new test case (with input parameters) matching selected generic types.
source§impl CaseGroup<Vec<i32>, i32, i32>
impl CaseGroup<Vec<i32>, i32, i32>
Implement two handy methods on CaseGroup struct.
sourcepub fn create(&mut self, ipt: Vec<i32>, exp: Vec<i32>)
pub fn create(&mut self, ipt: Vec<i32>, exp: Vec<i32>)
Create a new test case (no input parameters) matching selected generic types.
sourcepub fn create_param(&mut self, ipt: Vec<i32>, exp: Vec<i32>, params: Vec<i32>)
pub fn create_param(&mut self, ipt: Vec<i32>, exp: Vec<i32>, params: Vec<i32>)
Create a new test case (with input parameters) matching selected generic types.
source§impl CaseGroup<Vec<i32>, Vec<Vec<i32>>, i32>
impl CaseGroup<Vec<i32>, Vec<Vec<i32>>, i32>
Implement two handy methods on CaseGroup struct.
sourcepub fn create(&mut self, ipt: Vec<i32>, exp: Vec<Vec<Vec<i32>>>)
pub fn create(&mut self, ipt: Vec<i32>, exp: Vec<Vec<Vec<i32>>>)
Create a new test case (no input parameters) matching selected generic types.
sourcepub fn create_param(
&mut self,
ipt: Vec<i32>,
exp: Vec<Vec<Vec<i32>>>,
params: Vec<i32>
)
pub fn create_param(
&mut self,
ipt: Vec<i32>,
exp: Vec<Vec<Vec<i32>>>,
params: Vec<i32>
)
Create a new test case (with input parameters) matching selected generic types.