mirror of
https://github.com/openharmony/third_party_rust_tinyvec.git
synced 2026-07-18 12:25:35 -04:00
Account for heap capacity in capacity unit test
This commit is contained in:
+5
-2
@@ -23,8 +23,11 @@ fn TinyVec_swap_remove() {
|
||||
|
||||
#[test]
|
||||
fn TinyVec_capacity() {
|
||||
let tv: TinyVec<[i32; 10]> = Default::default();
|
||||
assert_eq!(tv.capacity(), 10);
|
||||
let mut tv: TinyVec<[i32; 1]> = Default::default();
|
||||
assert_eq!(tv.capacity(), 1);
|
||||
tv.move_to_the_heap();
|
||||
tv.extend_from_slice(&[1, 2, 3, 4]);
|
||||
assert_eq!(tv.capacity(), 4);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user