Skip to content

Commit 200d398

Browse files
committed
Add more from_vec_dim_stride tests
1 parent 2cd9b08 commit 200d398

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/array.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,18 @@ fn from_vec_dim_stride_2d_5() {
499499
assert_matches!(OwnedArray::from_vec_dim_stride(d, s, a.as_slice().unwrap().to_vec()), Ok(_));
500500
}
501501

502+
#[test]
503+
fn from_vec_dim_stride_2d_6() {
504+
let a = [1., 2., 3., 4., 5., 6.];
505+
let d = (2, 1, 1);
506+
let s = (2, 2, 1);
507+
assert_matches!(OwnedArray::from_vec_dim_stride(d, s, a.to_vec()), Ok(_));
508+
509+
let d = (1, 2, 1);
510+
let s = (2, 2, 1);
511+
assert_matches!(OwnedArray::from_vec_dim_stride(d, s, a.to_vec()), Ok(_));
512+
}
513+
502514
#[test]
503515
fn from_vec_dim_stride_2d_rejects() {
504516
let two = [1., 2.];

0 commit comments

Comments
 (0)