pub enum SourceType<T = ()>where
T: DeserializeOwned,{
JsonFile(&'static str, PhantomData<T>),
}Expand description
A source type to generate tests from.
T: The type to deserialize into. If omitted, the macro attempts to infer it from function signature.
Variants§
JsonFile(&'static str, PhantomData<T>)
Pass a path to a JSON file.
§Example
// Inferred:
#[test_case_source(JsonFile("data.json"))]
fn my_test(data: User) { ... }
// Explicit:
#[test_case_source(SourceType::<User>::JsonFile("data.json"))]
fn my_test<T: Debug>(data: T) { ... }Auto Trait Implementations§
impl<T> Freeze for SourceType<T>
impl<T> RefUnwindSafe for SourceType<T>where
T: RefUnwindSafe,
impl<T> Send for SourceType<T>where
T: Send,
impl<T> Sync for SourceType<T>where
T: Sync,
impl<T> Unpin for SourceType<T>where
T: Unpin,
impl<T> UnwindSafe for SourceType<T>where
T: UnwindSafe,
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