forked from mirrors/gecko-dev
		
	 7160366b8c
			
		
	
	
		7160366b8c
		
	
	
	
	
		
			
			MozReview-Commit-ID: Grf1bKIx2iT --HG-- extra : rebase_source : 8013a66263a3a014944b0815ff9bc7d8ac0ad9a3
		
			
				
	
	
		
			23 lines
		
	
	
	
		
			574 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
	
		
			574 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| #![cfg(feature = "heapsize_impl")]
 | |
| 
 | |
| extern crate heapsize;
 | |
| extern crate linked_hash_map;
 | |
| 
 | |
| use linked_hash_map::LinkedHashMap;
 | |
| use heapsize::HeapSizeOf;
 | |
| 
 | |
| #[test]
 | |
| fn empty() {
 | |
|     assert_eq!(LinkedHashMap::<String, String>::new().heap_size_of_children(), 0);
 | |
| }
 | |
| 
 | |
| #[test]
 | |
| fn nonempty() {
 | |
|     let mut map = LinkedHashMap::new();
 | |
|     map.insert("hello".to_string(), "world".to_string());
 | |
|     map.insert("hola".to_string(), "mundo".to_string());
 | |
|     map.insert("bonjour".to_string(), "monde".to_string());
 | |
|     map.remove("hello");
 | |
| 
 | |
|     assert!(map.heap_size_of_children() != 0);
 | |
| }
 |