We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1c1887 commit f6777dbCopy full SHA for f6777db
src/test/run-pass/lib-map.rs
@@ -342,8 +342,26 @@ fn test_removal() {
342
log "*** finished test_removal";
343
}
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
355
356
+ assert (std::option::is_none(map.find(key)));
357
358
+ assert (std::option::get(map.find(key)) == "val");
359
360
361
fn main() {
362
test_simple();
363
test_growth();
364
test_removal();
365
+ test_contains_key();
366
+ test_find();
367
0 commit comments