Tests: use helper function to assert compile-time and run-time type check

To cleanup warnings about useless cast or type check that is always true.
This commit is contained in:
Ilya Gorbunov
2017-12-25 21:07:20 +03:00
parent ecd42f14b3
commit 053f3b6ac0
7 changed files with 79 additions and 55 deletions
@@ -16,6 +16,7 @@
package test.collections
import test.assertStaticAndRuntimeTypeIs
import kotlin.test.*
import test.collections.behaviors.*
import test.comparisons.STRING_CASE_INSENSITIVE_ORDER
@@ -53,9 +54,7 @@ class CollectionTest {
assertEquals(2, foo.size)
assertEquals(listOf("foo", "bar"), foo)
assertTrue {
foo is List<String>
}
assertStaticAndRuntimeTypeIs<List<String>>(foo)
}
/*
@@ -93,9 +92,7 @@ class CollectionTest {
assertEquals(1, foo.size)
assertEquals(hashSetOf("foo"), foo)
assertTrue {
foo is HashSet<String>
}
assertStaticAndRuntimeTypeIs<HashSet<String>>(foo)
}
@Test fun filterIsInstanceList() {