mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
Fix std tests
This commit is contained in:
parent
d3b49c2ed2
commit
c5ff54cbdb
@ -774,11 +774,11 @@ fn test_occupied_entry_key() {
|
|||||||
let key = "hello there";
|
let key = "hello there";
|
||||||
let value = "value goes here";
|
let value = "value goes here";
|
||||||
assert!(a.is_empty());
|
assert!(a.is_empty());
|
||||||
a.insert(key.clone(), value.clone());
|
a.insert(key, value);
|
||||||
assert_eq!(a.len(), 1);
|
assert_eq!(a.len(), 1);
|
||||||
assert_eq!(a[key], value);
|
assert_eq!(a[key], value);
|
||||||
|
|
||||||
match a.entry(key.clone()) {
|
match a.entry(key) {
|
||||||
Vacant(_) => panic!(),
|
Vacant(_) => panic!(),
|
||||||
Occupied(e) => assert_eq!(key, *e.key()),
|
Occupied(e) => assert_eq!(key, *e.key()),
|
||||||
}
|
}
|
||||||
@ -793,11 +793,11 @@ fn test_vacant_entry_key() {
|
|||||||
let value = "value goes here";
|
let value = "value goes here";
|
||||||
|
|
||||||
assert!(a.is_empty());
|
assert!(a.is_empty());
|
||||||
match a.entry(key.clone()) {
|
match a.entry(key) {
|
||||||
Occupied(_) => panic!(),
|
Occupied(_) => panic!(),
|
||||||
Vacant(e) => {
|
Vacant(e) => {
|
||||||
assert_eq!(key, *e.key());
|
assert_eq!(key, *e.key());
|
||||||
e.insert(value.clone());
|
e.insert(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert_eq!(a.len(), 1);
|
assert_eq!(a.len(), 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user