Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sebcrozet committed Oct 16, 2024
1 parent 33d5db4 commit f249917
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/core/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ macro_rules! array_row_vector_conversion(
($($array_vector_conversion_i: ident, $Vector: ident, $SZ: expr);* $(;)*) => {$(
#[test]
fn $array_vector_conversion_i() {
let v = $Vector::from_fn(|_, i| i);
let v: $Vector<_> = $Vector::from_fn(|_, i| i);
let arr: [usize; $SZ] = v.into();
let arr_ref = v.as_ref();
let arr_ref: &[_] = v.as_ref();
let v2 = $Vector::from(arr);

for i in 0 .. $SZ {
Expand Down Expand Up @@ -207,13 +207,13 @@ macro_rules! array_matrix_conversion(
fn $array_matrix_conversion_i_j() {
let m = $Matrix::from_fn(|i, j| i * 10 + j);
let arr: [[usize; $NRows]; $NCols] = m.into();
let arr_ref = m.as_ref();
let arr_ref: &[_] = m.as_ref();
let m2 = $Matrix::from(arr);

for i in 0 .. $NRows {
for j in 0 .. $NCols {
assert_eq!(arr[j][i], i * 10 + j);
assert_eq!(arr_ref[j][i], i * 10 + j);
assert_eq!(arr_ref[j * $NRows + i], i * 10 + j);
}
}

Expand Down

0 comments on commit f249917

Please sign in to comment.