Skip to content

Commit

Permalink
Added tests for instruction cloning / copying.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregoire Geis committed Sep 29, 2017
1 parent a71e9fb commit df22627
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/test_values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ fn test_instructions() {
assert_eq!(ptr.as_instruction().unwrap().get_opcode(), IntToPtr);
assert_eq!(free_instruction.get_opcode(), Call);
assert_eq!(return_instruction.get_opcode(), Return);

// test instruction cloning
let instruction_clone = return_instruction.clone();

assert_eq!(instruction_clone.get_opcode(), return_instruction.get_opcode());
assert_ne!(instruction_clone, return_instruction);

// test copying
let instruction_clone_copy = instruction_clone;

assert_eq!(instruction_clone, instruction_clone_copy);
}

#[test]
Expand Down Expand Up @@ -693,4 +704,4 @@ fn test_value_copies() {
let i8_value_copy = i8_value;

assert_eq!(i8_value, i8_value_copy);
}
}

0 comments on commit df22627

Please sign in to comment.