Add unit test for ArrayVec::extend_from_slice

Test that we can extend an `ArrayVec` with a slice that is less than
remaining capacity.
This commit is contained in:
Tobin C. Harding 2024-08-30 03:00:15 +10:00
parent 798c9cff1c
commit 4024ba5910
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 6 additions and 0 deletions

View File

@ -181,4 +181,10 @@ mod tests {
let mut av = ArrayVec::<_, 0>::new();
av.extend_from_slice(&[42]);
}
#[test]
fn extend_from_slice() {
let mut av = ArrayVec::<u8, 8>::new();
av.extend_from_slice(b"abc");
}
}