From 043eddb432d0e006055250504d9c0e47b7e839f5 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Fri, 27 Dec 2019 23:16:40 +0300 Subject: [PATCH] Cleanup: use effects introduced by contracts of assert* functions --- libraries/kotlin.test/jvm/src/test/kotlin/TestJVMTest.kt | 8 ++++---- libraries/stdlib/test/text/RegexTest.kt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/kotlin.test/jvm/src/test/kotlin/TestJVMTest.kt b/libraries/kotlin.test/jvm/src/test/kotlin/TestJVMTest.kt index c8ff2b6e496..f3fe21803e6 100644 --- a/libraries/kotlin.test/jvm/src/test/kotlin/TestJVMTest.kt +++ b/libraries/kotlin.test/jvm/src/test/kotlin/TestJVMTest.kt @@ -30,14 +30,14 @@ class TestJVMTest { @Test fun assertEqualsMessage() { expectAssertion({ msg -> - assertNotNull(msg); msg!! + assertNotNull(msg) assertTrue { msg.contains(expected.toString()) } assertTrue { msg.contains(actual.toString()) } assertFalse { msg.startsWith(".") } }, { assertEquals(expected, actual) }) expectAssertion({ msg -> - assertNotNull(msg); msg!! + assertNotNull(msg) assertTrue { msg.contains(message) } assertTrue { msg.contains(expected.toString()) } assertTrue { msg.contains(actual.toString()) } @@ -47,13 +47,13 @@ class TestJVMTest { @Test fun assertNotEqualsMessage() { expectAssertion({ msg -> - assertNotNull(msg); msg!! + assertNotNull(msg) assertTrue { msg.contains(actual.toString()) } assertFalse { msg.startsWith(".") } }, { assertNotEquals(actual, actual) }) expectAssertion({ msg -> - assertNotNull(msg); msg!! + assertNotNull(msg) assertTrue { msg.contains(message) } assertTrue { msg.contains(actual.toString()) } }, { assertNotEquals(actual, actual, message) }) diff --git a/libraries/stdlib/test/text/RegexTest.kt b/libraries/stdlib/test/text/RegexTest.kt index 43f633108ea..1bb736c5089 100644 --- a/libraries/stdlib/test/text/RegexTest.kt +++ b/libraries/stdlib/test/text/RegexTest.kt @@ -32,7 +32,7 @@ class RegexTest { assertTrue(p in input) val first = p.find(input) - assertTrue(first != null); first!! + assertNotNull(first) assertEquals("123", first.value) val second1 = first.next()!!