Skip to content

Commit

Permalink
Added tests for copying
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregoire Geis committed Sep 29, 2017
1 parent a71114c commit a71e9fb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,12 @@ fn test_vec_type() {

assert_eq!(vec_type.get_size(), 42);
}

#[test]
fn test_type_copies() {
let context = Context::create();
let i8_type = context.i8_type();
let i8_type_copy = i8_type;

assert_eq!(i8_type, i8_type_copy);
}
11 changes: 11 additions & 0 deletions tests/test_values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -683,3 +683,14 @@ fn test_int_from_string() {

assert_eq!(i8_val.print_to_string(), &*CString::new("i8 -15").unwrap());
}

#[test]
fn test_value_copies() {
let context = Context::create();
let i8_type = context.i8_type();

let i8_value = i8_type.const_int(12, false);
let i8_value_copy = i8_value;

assert_eq!(i8_value, i8_value_copy);
}

0 comments on commit a71e9fb

Please sign in to comment.