aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin/model/LinkTest.kt
diff options
context:
space:
mode:
authoraleksZubakov <aleks.zubakov@gmail.com>2018-07-12 20:23:02 +0300
committeraleksZubakov <aleks.zubakov@gmail.com>2018-07-12 20:23:02 +0300
commit742be4ef7c024a5ea6023fb684cd24d1898f37e4 (patch)
tree34fc44ef7ee5afdb7a153367d80872f74ace4937 /core/src/test/kotlin/model/LinkTest.kt
parentb4fcc57ab7f335459131ce105924eeaa5fa77375 (diff)
downloaddokka-742be4ef7c024a5ea6023fb684cd24d1898f37e4.tar.gz
dokka-742be4ef7c024a5ea6023fb684cd24d1898f37e4.tar.bz2
dokka-742be4ef7c024a5ea6023fb684cd24d1898f37e4.zip
Test refactoring, add common platform tests
Diffstat (limited to 'core/src/test/kotlin/model/LinkTest.kt')
-rw-r--r--core/src/test/kotlin/model/LinkTest.kt22
1 files changed, 14 insertions, 8 deletions
diff --git a/core/src/test/kotlin/model/LinkTest.kt b/core/src/test/kotlin/model/LinkTest.kt
index d7283bae..9b2f9f0d 100644
--- a/core/src/test/kotlin/model/LinkTest.kt
+++ b/core/src/test/kotlin/model/LinkTest.kt
@@ -3,12 +3,14 @@ package org.jetbrains.dokka.tests
import org.jetbrains.dokka.ContentBlock
import org.jetbrains.dokka.ContentNodeLazyLink
import org.jetbrains.dokka.NodeKind
+import org.jetbrains.dokka.Platform
import org.junit.Assert.assertEquals
import org.junit.Test
-class LinkTest {
+abstract class BaseLinkTest(val analysisPlatform: Platform) {
+ private val defaultModelConfig = ModelConfig(analysisPlatform = analysisPlatform)
@Test fun linkToSelf() {
- checkSourceExistsAndVerifyModel("testdata/links/linkToSelf.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/links/linkToSelf.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals("Foo", name)
assertEquals(NodeKind.Class, kind)
@@ -18,7 +20,7 @@ class LinkTest {
}
@Test fun linkToMember() {
- checkSourceExistsAndVerifyModel("testdata/links/linkToMember.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/links/linkToMember.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals("Foo", name)
assertEquals(NodeKind.Class, kind)
@@ -28,7 +30,7 @@ class LinkTest {
}
@Test fun linkToConstantWithUnderscores() {
- checkSourceExistsAndVerifyModel("testdata/links/linkToConstantWithUnderscores.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/links/linkToConstantWithUnderscores.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals("Foo", name)
assertEquals(NodeKind.Class, kind)
@@ -38,7 +40,7 @@ class LinkTest {
}
@Test fun linkToQualifiedMember() {
- checkSourceExistsAndVerifyModel("testdata/links/linkToQualifiedMember.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/links/linkToQualifiedMember.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals("Foo", name)
assertEquals(NodeKind.Class, kind)
@@ -48,7 +50,7 @@ class LinkTest {
}
@Test fun linkToParam() {
- checkSourceExistsAndVerifyModel("testdata/links/linkToParam.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/links/linkToParam.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals("Foo", name)
assertEquals(NodeKind.Function, kind)
@@ -58,7 +60,7 @@ class LinkTest {
}
@Test fun linkToPackage() {
- checkSourceExistsAndVerifyModel("testdata/links/linkToPackage.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/links/linkToPackage.kt", defaultModelConfig) { model ->
val packageNode = model.members.single()
with(packageNode) {
assertEquals(this.name, "test.magic")
@@ -72,4 +74,8 @@ class LinkTest {
}
}
-} \ No newline at end of file
+}
+
+class JSLinkTest: BaseLinkTest(Platform.js)
+class JVMLinkTest: BaseLinkTest(Platform.jvm)
+class CommonLinkTest: BaseLinkTest(Platform.common) \ No newline at end of file