added filterNot method

This commit is contained in:
James Strachan
2011-12-23 16:27:40 +00:00
parent 310a49eaff
commit 3fa49cadc0
4 changed files with 37 additions and 0 deletions
+10
View File
@@ -39,6 +39,16 @@ class CollectionTest() : TestSupport() {
assertEquals(arrayList("foo"), foo)
}
fun testFilterNot() {
val foo = data.filterNot{it.startsWith("b")}
assert {
foo.all{it.startsWith("f")}
}
assertEquals(1, foo.size)
assertEquals(arrayList("foo"), foo)
}
fun testFilterIntoLinkedList() {
// TODO would be nice to avoid the <String>
val foo = data.filter(linkedList<String>()){it.startsWith("f")}