Skip to content

Commit 815a429

Browse files
committed
Add test for as_flattened(_mut)
1 parent 3228526 commit 815a429

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ const EXAMPLE_SLICE: &[u8] = &[1, 2, 3, 4, 5, 6];
99
/// Ensure `ArrayN` works as expected.
1010
const _FOO: ArrayN<u8, 4> = Array([1, 2, 3, 4]);
1111

12+
#[test]
13+
fn as_flattened() {
14+
type A = Array<u8, U2>;
15+
type B = Array<A, U2>;
16+
17+
let mut array: B = Array([Array([b't', b'e']), Array([b's', b't'])]);
18+
assert_eq!(array.as_flattened(), b"test");
19+
assert_eq!(array.as_flattened_mut(), b"test");
20+
}
21+
1222
#[test]
1323
fn as_ref_core_array() {
1424
type A = Array<u8, U2>;

0 commit comments

Comments
 (0)