Skip to content

Commit

Permalink
Tests that the *Assign operators work for slices via deref
Browse files Browse the repository at this point in the history
  • Loading branch information
akern40 committed Oct 14, 2024
1 parent 663e2f9 commit 5204f68
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2819,3 +2819,11 @@ fn test_split_complex_invert_axis()
assert_eq!(cmplx.re, a.mapv(|z| z.re));
assert_eq!(cmplx.im, a.mapv(|z| z.im));
}

#[test]
fn test_slice_assing()
{
let mut a = array![0, 1, 2, 3, 4];
*a.slice_mut(s![1..3]) += 1;
assert_eq!(a, array![0, 2, 3, 3, 4]);
}

0 comments on commit 5204f68

Please sign in to comment.