mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 09:31:34 +11:00
Move the tests to a better location
This commit is contained in:
parent
a44b8a4013
commit
78554862c8
|
@ -1263,6 +1263,22 @@ mod test {
|
||||||
drop_registry.assert_dropped_n_times(id1, 2);
|
drop_registry.assert_dropped_n_times(id1, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test_case]
|
||||||
|
fn test_retain(_gba: &mut Gba) {
|
||||||
|
let mut map = HashMap::new();
|
||||||
|
|
||||||
|
for i in 0..100 {
|
||||||
|
map.insert(i, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
map.retain(|k, _| k % 2 == 0);
|
||||||
|
|
||||||
|
assert_eq!(map[&2], 2);
|
||||||
|
assert_eq!(map.get(&3), None);
|
||||||
|
|
||||||
|
assert_eq!(map.iter().count(), 50); // force full iteration
|
||||||
|
}
|
||||||
|
|
||||||
// Following test cases copied from the rust source
|
// Following test cases copied from the rust source
|
||||||
// https://github.com/rust-lang/rust/blob/master/library/std/src/collections/hash/map/tests.rs
|
// https://github.com/rust-lang/rust/blob/master/library/std/src/collections/hash/map/tests.rs
|
||||||
mod rust_std_tests {
|
mod rust_std_tests {
|
||||||
|
|
Loading…
Reference in a new issue