Skip to content

Commit

Permalink
test: Verify that arguments, if any, can be changed
Browse files Browse the repository at this point in the history
  • Loading branch information
aszepieniec authored and jan-ferdinand committed Aug 12, 2024
1 parent 171dfb2 commit e55c247
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions triton-vm/src/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1053,4 +1053,18 @@ pub mod tests {
let labelled_instruction = LabelledInstruction::Label("dummy_label".to_string());
assert!(0 == labelled_instruction.op_stack_size_influence());
}

#[test]
fn can_change_arg() {
for instruction in all_instructions_with_default_args() {
if let Some(arg) = instruction.arg() {
assert_ne!(
instruction,
(instruction.change_arg(arg + bfe!(1))).unwrap()
);
} else {
assert!(instruction.change_arg(bfe!(0)).is_err())
}
}
}
}

0 comments on commit e55c247

Please sign in to comment.