about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/to_str.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libcore/to_str.rs b/src/libcore/to_str.rs
index 299ba45986e..be0aa5138c7 100644
--- a/src/libcore/to_str.rs
+++ b/src/libcore/to_str.rs
@@ -209,4 +209,18 @@ mod tests {
         assert!(table_str == ~"{1: 2, 3: 4}" || table_str == ~"{3: 4, 1: 2}");
         assert!(empty.to_str() == ~"{}");
     }
+
+    #[test]
+    fn test_hashset() {
+        let mut set: HashSet<int, int> = HashSet::new();
+        let empty_set: HashSet<int, int> = HashSet::new();
+
+        set.insert(1);
+        set.insert(2);
+
+        let set_str = set.to_str();
+
+        assert!(set_str == ~"{1, 2}" || set_str == ~"{2, 1}");
+        assert!(empty.to_str() == ~"{}");
+    }
 }
\ No newline at end of file