mirror of
https://github.com/Noratrieb/awwoc.git
synced 2026-01-14 19:55:04 +01:00
yeah
This commit is contained in:
commit
763b057fe3
5 changed files with 241 additions and 0 deletions
28
tests/collections.rs
Normal file
28
tests/collections.rs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
use std::collections::BTreeMap;
|
||||
|
||||
use awwoc::Awwoc;
|
||||
|
||||
#[global_allocator]
|
||||
static AWWOC: Awwoc = Awwoc;
|
||||
|
||||
#[test]
|
||||
fn vec() {
|
||||
let mut vec = Vec::new();
|
||||
|
||||
for i in 0..10_000 {
|
||||
vec.push(i);
|
||||
}
|
||||
|
||||
assert!(vec.iter().enumerate().all(|(i, &item)| i == item));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn btree_map() {
|
||||
let mut map = BTreeMap::new();
|
||||
|
||||
for i in (0..1000).map(|i| i * 3) {
|
||||
map.insert(i, i + 10);
|
||||
}
|
||||
|
||||
assert!(map.iter().all(|(k, v)| *v == *k + 10));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue