diff options
author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2023-08-30 15:58:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-30 15:58:46 +0200 |
commit | c63ea36637ce956029fb15b1482c0683ecb8a587 (patch) | |
tree | 2b75a8a976b43530820e73dc60cce4b10d9fc005 /plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt | |
parent | 0e00edc6fcd406fcf38673ef6a2f8f59e8374de2 (diff) | |
download | dokka-c63ea36637ce956029fb15b1482c0683ecb8a587.tar.gz dokka-c63ea36637ce956029fb15b1482c0683ecb8a587.tar.bz2 dokka-c63ea36637ce956029fb15b1482c0683ecb8a587.zip |
Migrate to JUnit 5 and unify used test API (#3138)
Diffstat (limited to 'plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt')
-rw-r--r-- | plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt b/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt index 1d86f219..29905035 100644 --- a/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt +++ b/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt @@ -1,11 +1,12 @@ package expect import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.junit.jupiter.api.Assertions.assertTrue import java.nio.file.Files import java.nio.file.Path import java.nio.file.Paths import java.util.concurrent.TimeUnit +import kotlin.test.assertEquals +import kotlin.test.assertTrue abstract class AbstractExpectTest( val testDir: Path? = Paths.get("src/test", "resources", "expect"), @@ -40,9 +41,9 @@ abstract class AbstractExpectTest( ).also { logger.info("git diff command: ${it.command().joinToString(" ")}") } .also { it.redirectErrorStream() }.start() - assertTrue(gitCompare.waitFor(gitTimeout, TimeUnit.MILLISECONDS)) { "Git timed out after $gitTimeout" } + assertTrue(gitCompare.waitFor(gitTimeout, TimeUnit.MILLISECONDS), "Git timed out after $gitTimeout") gitCompare.inputStream.bufferedReader().lines().forEach { logger.info(it) } - assertTrue(gitCompare.exitValue() == 0) { "${path.fileName}: outputs don't match" } + assertEquals(0, gitCompare.exitValue(), "${path.fileName}: outputs don't match") } ?: throw AssertionError("obtained path is null") } @@ -54,7 +55,7 @@ abstract class AbstractExpectTest( ) { obtained?.let { _ -> val (res, out, err) = runDiff(expected, obtained, excludes, timeout) - assertTrue(res == 0, "Outputs differ:\nstdout - $out\n\nstderr - ${err ?: ""}") + assertEquals(0, res, "Outputs differ:\nstdout - $out\n\nstderr - ${err ?: ""}") } ?: throw AssertionError("obtained path is null") } |