File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -175,15 +175,17 @@ mod tests {
175
175
~" [ [ ] , [ 1 ] , [ 1 , 1 ] ] ");
176
176
}
177
177
178
- // #[test]
179
- // fn test_hashmap() {
180
- // let mut table: HashMap<int, int> = HashMap::new();
181
- // let mut empty: HashMap<int, int> = HashMap::new();
178
+ #[test]
179
+ fn test_hashmap() {
180
+ let mut table: HashMap<int, int> = HashMap::new();
181
+ let empty: HashMap<int, int> = HashMap::new();
182
+
183
+ table.insert(3, 4);
184
+ table.insert(1, 2);
182
185
183
- // table.insert(3, 4);
184
- // table.insert(1, 2);
186
+ let table_str = table.to_str();
185
187
186
- // assert!(table.to_str() == ~" { 1 : 2 , 3 : 4 } ");
187
- // assert!(empty.to_str() == ~" { } " ) ;
188
- // }
188
+ assert!(table_str == ~" { 1 : 2 , 3 : 4 } " || table_str == ~" { 3 : 4 , 1 : 2 } ");
189
+ assert!(empty.to_str() == ~" { } " ) ;
190
+ }
189
191
}
You can’t perform that action at this time.
0 commit comments