diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2019-10-29 11:46:04 +0100 |
---|---|---|
committer | Kamil Doległo <kamilok1965@interia.pl> | 2019-10-29 15:49:53 +0100 |
commit | 14a290009098b777521b1dedb551047fb66ba73b (patch) | |
tree | ae68219051b080ff8888308d5521aaeea7431fb4 /core/src/test/kotlin/dri | |
parent | 5f358199788fefb78f5db7791e718480793a77fc (diff) | |
download | dokka-14a290009098b777521b1dedb551047fb66ba73b.tar.gz dokka-14a290009098b777521b1dedb551047fb66ba73b.tar.bz2 dokka-14a290009098b777521b1dedb551047fb66ba73b.zip |
[WIP] new model
Diffstat (limited to 'core/src/test/kotlin/dri')
-rw-r--r-- | core/src/test/kotlin/dri/DRITest.kt | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/core/src/test/kotlin/dri/DRITest.kt b/core/src/test/kotlin/dri/DRITest.kt new file mode 100644 index 00000000..b763bce8 --- /dev/null +++ b/core/src/test/kotlin/dri/DRITest.kt @@ -0,0 +1,37 @@ +package org.jetbrains.dokka.tests.dri + +import org.jetbrains.dokka.links.Callable +import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.resolvers.toJavadocLocation +import org.junit.Test +import kotlin.test.assertEquals + +class DRITest { + @Test + fun onlyClassNames() { + val expected = DRI(classNames = "className1.className2") + val actual = DRI.from("/className1.className2////") + assertEquals(expected, actual) + } + + @Test + fun fullDRI() { + val expected = DRI("org.dokka", "className1.className2", Callable("<init>", "", "", listOf("Int")), 2, "something" ) + val actual = DRI.from("org.dokka/className1.className2/<init>/..Int/2/something") + assertEquals(expected, actual) + } + + @Test + fun onlyExtra() { + val expected = DRI(null, null, null, null, "extra" ) + val actual = DRI.from("/////extra") + assertEquals(expected, actual) + } + + @Test + fun javadoc8Location() { + val dri = DRI("org.jetbrains.dokka", "DRITest", "javadocLocation", ".void.") + assertEquals("org/jetbrains/dokka/DRITest.html#javadocLocation--", dri.toJavadocLocation(8)) + } +} + |