Skip to content

Commit 4214528

Browse files
committed
Tested test utils...
Signed-off-by: Marvin Hansen <[email protected]>
1 parent 3966977 commit 4214528

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

deep_causality/src/utils_test/test_utils_generator.rs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ where
9393
SYM: Symbolic + Clone,
9494
VS: Clone,
9595
VT: Clone,
96-
{
96+
{
9797
fn default() -> Self {
9898
Self::new()
9999
}
@@ -192,3 +192,29 @@ impl
192192
Ok(GenerativeOutput::NoOp)
193193
}
194194
}
195+
196+
#[cfg(test)]
197+
mod tests {
198+
use super::*;
199+
200+
#[test]
201+
fn test_dummy_generator_no_op() {
202+
let mut generator = DummyGenerator;
203+
let trigger = GenerativeTrigger::ManualIntervention("test".to_string());
204+
205+
// Create a context of the correct type: TestContext (which is Context<MockData, ...>)
206+
let context: TestContext = TestContext::with_capacity(1, "Test Context", 10);
207+
208+
let result = generator.generate(&trigger, &context);
209+
210+
assert!(result.is_ok());
211+
match result.unwrap() {
212+
GenerativeOutput::NoOp => {
213+
// This is the expected outcome
214+
}
215+
_ => {
216+
panic!("DummyGenerator should always return GenerativeOutput::NoOp");
217+
}
218+
}
219+
}
220+
}

0 commit comments

Comments
 (0)