diff options
Diffstat (limited to 'src/castable_factory/blocking.rs')
-rw-r--r-- | src/castable_factory/blocking.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/castable_factory/blocking.rs b/src/castable_factory/blocking.rs index 5ff4db0..5dc12e5 100644 --- a/src/castable_factory/blocking.rs +++ b/src/castable_factory/blocking.rs @@ -72,3 +72,26 @@ where ReturnInterface: 'static + ?Sized, { } + +#[cfg(test)] +mod tests +{ + use super::*; + + #[test] + fn can_call() + { + #[derive(Debug, PartialEq, Eq)] + struct Bacon + { + heal_amount: u32, + } + + let castable_factory = + CastableFactory::new(&|heal_amount| TransientPtr::new(Bacon { heal_amount })); + + let output = castable_factory(27); + + assert_eq!(output, Box::new(Bacon { heal_amount: 27 })); + } +} |