Skip to content

Commit 8be80e1

Browse files
committed
feat: tests
1 parent 64a8609 commit 8be80e1

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/test_arrays.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
use rem_math::native::sum_arr_int32;
2+
use rem_math::native::sum_two_floats32;
3+
4+
#[test]
5+
fn test_sum_arr_i32() {
6+
let arr = vec![1; 10];
7+
assert_eq!(10, sum_arr_int32(arr.clone(), false));
8+
assert_eq!(10, sum_arr_int32(arr.clone(), true));
9+
}
10+
11+
#[test]
12+
fn test_sum_two_floats32() {
13+
let arr = vec![1.0; 5];
14+
let expected_arr = vec![2.0, 2.0, 2.0, 2.0, 2.0];
15+
16+
assert_eq!(expected_arr, sum_two_floats32(arr.clone(), arr.clone(), false));
17+
assert_eq!(expected_arr, sum_two_floats32(arr.clone(), arr.clone(), true));
18+
}

0 commit comments

Comments
 (0)