implemented containerType.count(predicate)

This commit is contained in:
James Strachan
2011-12-23 16:48:22 +00:00
parent 3fa49cadc0
commit aa46952531
2 changed files with 16 additions and 1 deletions
+6 -1
View File
@@ -29,6 +29,12 @@ class CollectionTest() : TestSupport() {
}
}
fun testCount() {
assertEquals(1, data.count{it.startsWith("b")})
// TODO size should implement size property to be polymorphic with collections
assertEquals(2, data.count{it.length == 3})
}
fun testFilter() {
val foo = data.filter{it.startsWith("f")}
@@ -153,5 +159,4 @@ class CollectionTest() : TestSupport() {
}
}
}
}