INNER CODE UNIT · Rust
remove_handles_non_existent_id
lunatic-solutions/lunatic · crates/hash-map-id/src/lib.rs:140
fn remove_handles_non_existent_id() {
let mut hash: HashMapId<i32> = HashMapId::new();
let result = hash.remove(1);
assert!(result.is_none());
}
#[test]
fn remove_returns_removed_value() {
let mut hash: HashMapId<i32> = HashMapId::new();
let value = 10;
let id = hash.add(value);
let removed_value = hash.remove(id);
assert_eq!(removed_value, Some(value));
}
#[test]
fn remove_removes_id() {
let mut hash: HashMapId<i32> = HashMapId::new();