1 extern crate ralloc; 2 3 #[global_allocator] 4 static ALLOCATOR: ralloc::Allocator = ralloc::Allocator; 5 6 mod util; 7 8 use std::collections::BTreeMap; 9 10 #[test] 11 fn btreemap() { 12 util::multiply(|| { 13 let mut map = BTreeMap::new(); 14 15 util::acid(|| { 16 map.insert("Nicolas", "Cage"); 17 map.insert("is", "God"); 18 map.insert("according", "to"); 19 map.insert("ca1ek", "."); 20 }); 21 22 assert_eq!(map.get("Nicolas"), Some(&"Cage")); 23 assert_eq!(map.get("is"), Some(&"God")); 24 assert_eq!(map.get("according"), Some(&"to")); 25 assert_eq!(map.get("ca1ek"), Some(&".")); 26 assert_eq!(map.get("This doesn't exist."), None); 27 }); 28 } 29