Skip to content

Commit

Permalink
test for Array::map (#63)
Browse files Browse the repository at this point in the history
see #61
  • Loading branch information
baloo authored Mar 5, 2024
1 parent ced37f0 commit ce4b180
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,10 @@ fn maybe_uninit() {
let array = unsafe { uninit_array.assume_init() };
assert_eq!(array.as_slice(), EXAMPLE_SLICE);
}

#[test]
fn test_map() {
let base = Array::<u8, U4>::from([1, 2, 3, 4]);
let expected = Array::<u16, U4>::from([2, 3, 4, 5]);
assert_eq!(base.map(|item| (item as u16) + 1), expected);
}

0 comments on commit ce4b180

Please sign in to comment.