reified assertFailsWith available in kotlin-test for JS

#KT-11346
This commit is contained in:
Ilya Gorbunov
2016-04-25 19:40:22 +03:00
parent 409094f0f7
commit 4b533b297e
9 changed files with 43 additions and 35 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ class MapTest {
@Suppress("INVISIBLE_MEMBER")
@test fun getOrImplicitDefault() {
val data: MutableMap<String, Int> = hashMapOf("bar" to 1)
assertTrue(assertFails { data.getOrImplicitDefault("foo") } is NoSuchElementException)
assertFailsWith<NoSuchElementException> { data.getOrImplicitDefault("foo") }
assertEquals(1, data.getOrImplicitDefault("bar"))
val mutableWithDefault = data.withDefault { 42 }