Skip to content

Commit d3460e8

Browse files
committed
add a test for zipping axis_windows with a 1d array
1 parent 6b0942f commit d3460e8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/windows.rs

+12
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,18 @@ fn test_axis_windows_3d() {
266266
);
267267
}
268268

269+
#[test]
270+
fn tests_axis_windows_3d_zips_with_1d() {
271+
let a = Array::from_iter(0..27).into_shape((3, 3, 3)).unwrap();
272+
let mut b = Array::zeros(2);
273+
274+
Zip::from(b.view_mut())
275+
.and(a.axis_windows(Axis(1), 2))
276+
.for_each(|b,a|{
277+
*b = a.sum();
278+
});
279+
assert_eq!(b,arr1(&[207, 261]));
280+
}
269281

270282
#[test]
271283
fn test_window_neg_stride() {

0 commit comments

Comments
 (0)