Add more tests to cover stdlib

This commit is contained in:
Ilya Ryzhenkov
2015-01-23 16:52:10 +03:00
parent 6fe483f0cf
commit 1a67e35739
3 changed files with 111 additions and 0 deletions
@@ -112,6 +112,22 @@ abstract class IterableTests<T : Iterable<String>>(val data: T, val empty: T) {
assertEquals(listOf("foo"), foo)
}
Test fun drop() {
val foo = data.drop(1)
expect(true) { foo is List<String> }
expect(true) { foo.all { it.startsWith("b") } }
expect(1) { foo.size() }
assertEquals(listOf("bar"), foo)
}
Test fun dropWhile() {
val foo = data.dropWhile { it[0] == 'f' }
expect(true) { foo is List<String> }
expect(true) { foo.all { it.startsWith("b") } }
expect(1) { foo.size() }
assertEquals(listOf("bar"), foo)
}
Test fun filterNot() {
val notFoo = data.filterNot { it.startsWith("f") }
expect(true) { notFoo is List<String> }