mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update heap size tests for Vec allocation strategy change.
This commit is contained in:
parent
47b07ae2e4
commit
f10851e788
1 changed files with 4 additions and 1 deletions
|
@ -64,9 +64,12 @@ fn test_heap_size() {
|
|||
assert_eq!(x.heap_size_of_children(), 8);
|
||||
|
||||
// An ascii string with 16 chars is 16 bytes in UTF-8.
|
||||
assert_eq!(String::from("0123456789abcdef").heap_size_of_children(), 16);
|
||||
|
||||
// … but RawVec::reserve gives twice the requested capacity.
|
||||
let mut x = String::new();
|
||||
x.push_str("0123456789abcdef");
|
||||
assert_eq!(x.heap_size_of_children(), 16);
|
||||
assert_eq!(x.heap_size_of_children(), 32);
|
||||
|
||||
// Not on the heap.
|
||||
let x: Option<i32> = None;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue