aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2023-08-30 15:58:46 +0200
committerGitHub <noreply@github.com>2023-08-30 15:58:46 +0200
commitc63ea36637ce956029fb15b1482c0683ecb8a587 (patch)
tree2b75a8a976b43530820e73dc60cce4b10d9fc005 /plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt
parent0e00edc6fcd406fcf38673ef6a2f8f59e8374de2 (diff)
downloaddokka-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/content/annotations/SinceKotlinTest.kt')
-rw-r--r--plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt23
1 files changed, 10 insertions, 13 deletions
diff --git a/plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt b/plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt
index 0b36031c..87b5c2fb 100644
--- a/plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt
+++ b/plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt
@@ -9,15 +9,12 @@ import org.jetbrains.dokka.model.dfs
import org.jetbrains.dokka.model.doc.CustomTagWrapper
import org.jetbrains.dokka.model.doc.Text
import org.jetbrains.dokka.pages.ContentPage
-import org.junit.jupiter.api.AfterEach
-import org.junit.jupiter.api.BeforeEach
-import org.junit.jupiter.api.Test
import signatures.AbstractRenderingTest
import utils.ParamAttributes
import utils.TestOutputWriterPlugin
import utils.assertNotNull
import utils.bareSignature
-import kotlin.test.assertEquals
+import kotlin.test.*
class SinceKotlinTest : AbstractRenderingTest() {
@@ -31,23 +28,23 @@ class SinceKotlinTest : AbstractRenderingTest() {
}
}
- @BeforeEach
+ @BeforeTest
fun setSystemProperty() {
System.setProperty(SinceKotlinTransformer.SHOULD_DISPLAY_SINCE_KOTLIN_SYS_PROP, "true")
}
- @AfterEach
+ @AfterTest
fun clearSystemProperty() {
System.clearProperty(SinceKotlinTransformer.SHOULD_DISPLAY_SINCE_KOTLIN_SYS_PROP)
}
@Test
fun versionsComparing() {
- assert(SinceKotlinVersion("1.0").compareTo(SinceKotlinVersion("1.0")) == 0)
- assert(SinceKotlinVersion("1.0.0").compareTo(SinceKotlinVersion("1")) == 0)
- assert(SinceKotlinVersion("1.0") >= SinceKotlinVersion("1.0"))
- assert(SinceKotlinVersion("1.1") > SinceKotlinVersion("1"))
- assert(SinceKotlinVersion("1.0") < SinceKotlinVersion("2.0"))
- assert(SinceKotlinVersion("1.0") < SinceKotlinVersion("2.2"))
+ assertTrue(SinceKotlinVersion("1.0").compareTo(SinceKotlinVersion("1.0")) == 0)
+ assertTrue(SinceKotlinVersion("1.0.0").compareTo(SinceKotlinVersion("1")) == 0)
+ assertTrue(SinceKotlinVersion("1.0") >= SinceKotlinVersion("1.0"))
+ assertTrue(SinceKotlinVersion("1.1") > SinceKotlinVersion("1"))
+ assertTrue(SinceKotlinVersion("1.0") < SinceKotlinVersion("2.0"))
+ assertTrue(SinceKotlinVersion("1.0") < SinceKotlinVersion("2.2"))
}
@Test
@@ -77,7 +74,7 @@ class SinceKotlinTest : AbstractRenderingTest() {
) {
renderingStage = { _, _ ->
val content = writerPlugin.renderedContent("root/test/index.html")
- assert(content.getElementsContainingOwnText("Since Kotlin").count() == 4)
+ assertEquals(4, content.getElementsContainingOwnText("Since Kotlin").count())
}
}
}