test added

This commit is contained in:
Svetlana Isakova
2013-09-16 18:01:07 +04:00
parent 845b6f7d7e
commit b9f55f5070
2 changed files with 21 additions and 0 deletions
@@ -0,0 +1,16 @@
package m
import java.util.HashSet
// ----------------------------------
fun <K, V> testGetOrPut(result : MutableMap<K, Set<V>>, key: K) {
result.getOrPut(key) { HashSet() }
}
fun <K,V> MutableMap<K,V>.getOrPut(key: K, defaultValue: ()-> V) : V = throw Exception("$key $defaultValue")
// ----------------------------------
class Property<T: Comparable<T>>(val name: String, val default: () -> T) {}
fun testProperty() = Property("", { -1.toLong() })
fun testProperty1() = Property("", { "" })