Support "key in map" using extension contains() function. #KT-3607 Fixed

This commit is contained in:
Ilya Ryzhenkov
2014-05-07 19:00:36 +04:00
committed by Andrey Breslav
parent 5f224efdc1
commit 5b73fba2d4
2 changed files with 7 additions and 0 deletions
@@ -105,6 +105,12 @@ class MapTest {
assertEquals("beverage,beer,location,Mells,name,James", list.makeString(","))
}
test fun contains() {
val map = hashMapOf("a" to 1, "b" to 2)
assert("a" in map)
assert("c" !in map)
}
test fun map() {
val m1 = TreeMap<String, String>()
m1["beverage"] = "beer"