Skip to content

Commit 0744748

Browse files
committed
Add test for Zip dimension mismatch
1 parent 1923258 commit 0744748

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/azip.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,13 @@ fn test_broadcast() {
9494
}
9595
assert!(a.all_close(&(&b + &d + &e), 1e-4));
9696
}
97+
98+
#[should_panic]
99+
#[test]
100+
fn test_zip_dim_mismatch_1() {
101+
let mut a = Array::zeros((5, 7));
102+
let mut d = a.raw_dim();
103+
d[0] += 1;
104+
let b = Array::from_shape_fn(d, |(i, j)| 1. / (i + 2*j) as f32);
105+
azip!(mut a, b in { *a = b; });
106+
}

0 commit comments

Comments
 (0)