Skip to content

Commit

Permalink
Improved tests for ExtendExpressions instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
mrLSD committed Mar 24, 2024
1 parent 24dc9ae commit a14cdee
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
25 changes: 18 additions & 7 deletions tests/expressions_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1409,22 +1409,33 @@ fn custom_expression() {
);
let bs = block_state.borrow().get_context().clone().get();
assert_eq!(bs.len(), 3);
println!("{bs:#?}");
/*

assert_eq!(
state[0],
bs[0],
SemanticStackContext::ExtendedExpression(Box::new(CustomExpressionInstruction::GoOut {
result: 30
}))
);
assert_eq!(
bs[1],
SemanticStackContext::ExtendedExpression(Box::new(CustomExpressionInstruction::GoIn {
index: 10,
value: 20,
}))
);
assert_eq!(
bs[2],
SemanticStackContext::ExpressionOperation {
operation: ExpressionOperations::Plus,
left_value: ExpressionResult {
expr_type: Type::Primitive(PrimitiveTypes::U32),
expr_value: ExpressionResultValue::Register(1)
expr_value: ExpressionResultValue::Register(1),
},
right_value: ExpressionResult {
expr_type: Type::Primitive(PrimitiveTypes::U32),
expr_value: ExpressionResultValue::Register(2)
expr_value: ExpressionResultValue::Register(2),
},
register_number: 3
register_number: 3,
}
);
*/
}
2 changes: 1 addition & 1 deletion tests/state_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ fn block_state_last_register_inc() {
}

#[test]
fn zblock_state_instructions_with_parent() {
fn block_state_instructions_with_parent() {
let parent_bst = Rc::new(RefCell::new(
BlockState::<CustomExpressionInstruction>::new(None),
));
Expand Down

0 comments on commit a14cdee

Please sign in to comment.