basic interpret_program test

This commit is contained in:
Rowan Torbitzky-Lane 2025-04-10 16:03:22 -05:00
parent 6f7b2d46c0
commit 4ea42a5b72

View File

@ -147,4 +147,21 @@ mod tests {
); );
// println!("{:?}", test_state.exec); // 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);
}
} }