mirror of
https://github.com/openharmony/third_party_rust_tinyvec.git
synced 2026-07-19 22:33:42 -04:00
Test and fix removal at past-the-end index
This commit is contained in:
@@ -123,6 +123,14 @@ fn ArrayVec_remove() {
|
||||
assert_eq!(&av[..], &[1, 3][..]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn ArrayVec_remove_invalid() {
|
||||
let mut av: ArrayVec<[i32; 1]> = Default::default();
|
||||
av.push(1);
|
||||
av.remove(1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ArrayVec_swap_remove() {
|
||||
let mut av: ArrayVec<[i32; 10]> = Default::default();
|
||||
|
||||
Reference in New Issue
Block a user