File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: f1c1887cabcb98ea1873427024e495ad64ae35f8
2
+ refs/heads/master: f6777db615fcbed28c9ed203e0f95bd143b019eb
Original file line number Diff line number Diff line change @@ -342,8 +342,26 @@ fn test_removal() {
342
342
log " * * * finished test_removal";
343
343
}
344
344
345
+ fn test_contains_key ( ) {
346
+ auto key = "k" ;
347
+ auto map = map:: mk_hashmap[ str, str] ( str:: hash, str:: eq) ;
348
+ assert ( !map. contains_key ( key) ) ;
349
+ map. insert ( key, "val" ) ;
350
+ assert ( map. contains_key ( key) ) ;
351
+ }
352
+
353
+ fn test_find ( ) {
354
+ auto key = "k" ;
355
+ auto map = map:: mk_hashmap[ str, str] ( str:: hash, str:: eq) ;
356
+ assert ( std:: option:: is_none ( map. find ( key) ) ) ;
357
+ map. insert ( key, "val" ) ;
358
+ assert ( std:: option:: get ( map. find ( key) ) == "val" ) ;
359
+ }
360
+
345
361
fn main ( ) {
346
362
test_simple ( ) ;
347
363
test_growth ( ) ;
348
364
test_removal ( ) ;
365
+ test_contains_key ( ) ;
366
+ test_find ( ) ;
349
367
}
You can’t perform that action at this time.
0 commit comments