From 4ea42a5b72f0745a2320d25d46d0e136ff4826ac Mon Sep 17 00:00:00 2001 From: Rowan Torbitzky-Lane Date: Thu, 10 Apr 2025 16:03:22 -0500 Subject: [PATCH] basic interpret_program test --- src/push/interpreter.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/push/interpreter.rs b/src/push/interpreter.rs index 772b65b..d563829 100644 --- a/src/push/interpreter.rs +++ b/src/push/interpreter.rs @@ -147,4 +147,21 @@ mod tests { ); // println!("{:?}", test_state.exec); } + + #[test] + fn interpret_program_test() { + use crate::instructions::numeric::int_add; + + let mut test_state = EMPTY_STATE; + + test_state.exec = vec![ + Gene::StateFunc(int_add), + Gene::StateFunc(int_add), + Gene::GeneInt(2), + Gene::GeneInt(3), + Gene::GeneInt(4), + ]; + interpret_program(&mut test_state, 1000, 1000); + assert_eq!(vec![9], test_state.int); + } }