Skip to content

Commit 9544e0b

Browse files
committed
Add to_shape test
1 parent e6f390f commit 9544e0b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/reshape.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,11 @@ fn to_shape_copy_stride() {
149149
assert_eq!(lin2, array![1, 5, 2, 6, 3, 7]);
150150
assert!(lin2.is_owned());
151151
}
152+
153+
#[test]
154+
#[should_panic(expected = "IncompatibleShape")]
155+
fn to_shape_error1() {
156+
let data = [1, 2, 3, 4, 5, 6, 7, 8];
157+
let v = aview1(&data);
158+
let _u = v.to_shape((2, 5)).unwrap();
159+
}

0 commit comments

Comments
 (0)