about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcollections/hashmap.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libcollections/hashmap.rs b/src/libcollections/hashmap.rs
index 35a89fe5dc5..87dc97d70c7 100644
--- a/src/libcollections/hashmap.rs
+++ b/src/libcollections/hashmap.rs
@@ -1299,9 +1299,10 @@ impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
     ///     );
     /// }
     ///
-    /// for (k, v) in map.iter() {
-    ///     println!("{} -> {}", *k, *v);
-    /// }
+    /// assert_eq!(map.len(), 3);
+    /// assert_eq!(map.get(&"a key"), &vec!["value", "new value"]);
+    /// assert_eq!(map.get(&"b key"), &vec!["new value"]);
+    /// assert_eq!(map.get(&"z key"), &vec!["new value", "value"]);
     /// ```
     pub fn find_with_or_insert_with<'a, A>(&'a mut self,
                                            k: K,