Skip to content

Commit 5204f68

Browse files
committed
Tests that the *Assign operators work for slices via deref
1 parent 663e2f9 commit 5204f68

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/array.rs

+8
Original file line numberDiff line numberDiff line change
@@ -2819,3 +2819,11 @@ fn test_split_complex_invert_axis()
28192819
assert_eq!(cmplx.re, a.mapv(|z| z.re));
28202820
assert_eq!(cmplx.im, a.mapv(|z| z.im));
28212821
}
2822+
2823+
#[test]
2824+
fn test_slice_assing()
2825+
{
2826+
let mut a = array![0, 1, 2, 3, 4];
2827+
*a.slice_mut(s![1..3]) += 1;
2828+
assert_eq!(a, array![0, 2, 3, 3, 4]);
2829+
}

0 commit comments

Comments
 (0)