fix tests for latest Rust

This commit is contained in:
Ralf Jung 2019-05-01 20:43:43 +02:00
parent d05159f3a9
commit b08bf47606
3 changed files with 2 additions and 6 deletions

View File

@ -1 +1 @@
fe0a415b4ba3310c2263f07e0253e2434310299c
7c71bc3208031b1307573de45a3b3e18fa45787a

View File

@ -1,7 +1,6 @@
#![feature(
async_await,
await_macro,
futures_api,
)]
use std::{future::Future, pin::Pin, task::Poll, ptr};

View File

@ -7,13 +7,10 @@ fn test_map<S: BuildHasher>(mut map: HashMap<i32, i32, S>) {
map.insert(0, 0);
assert_eq!(map.values().fold(0, |x, y| x+y), 0);
let table_base = map.get(&0).unwrap() as *const _;
let num = 22; // large enough to trigger a resize
let num = 25;
for i in 1..num {
map.insert(i, i);
}
assert!(table_base != map.get(&0).unwrap() as *const _); // make sure relocation happened
assert_eq!(map.values().fold(0, |x, y| x+y), num*(num-1)/2); // check the right things are in the table now
// Inserting again replaces the existing entries