diff options
author | Szymon Świstun <sswistun@virtuslab.com> | 2020-02-26 11:52:03 +0100 |
---|---|---|
committer | Kamil Doległo <kamilok1965@interia.pl> | 2020-02-28 16:37:40 +0100 |
commit | cacf1e0c6cda4e42fe6581946cad53a377c71ec7 (patch) | |
tree | c6bc41f74dde1962a0578597c5ddcc27fa356689 /testApi | |
parent | 77d6ce22a286601bc5d1401619eb42fac58e7013 (diff) | |
download | dokka-cacf1e0c6cda4e42fe6581946cad53a377c71ec7.tar.gz dokka-cacf1e0c6cda4e42fe6581946cad53a377c71ec7.tar.bz2 dokka-cacf1e0c6cda4e42fe6581946cad53a377c71ec7.zip |
Port some of the core tests from the previous model
Diffstat (limited to 'testApi')
-rw-r--r-- | testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt index 6a5bd303..485567ac 100644 --- a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt +++ b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt @@ -2,15 +2,12 @@ package testApi.testRunner import org.jetbrains.dokka.* import org.jetbrains.dokka.model.Module -import org.jetbrains.dokka.model.Package -import org.jetbrains.dokka.model.doc.DocumentationNode import org.jetbrains.dokka.pages.ModulePageNode import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.pages.RootPageNode import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.utilities.DokkaConsoleLogger -import org.junit.Assert import org.junit.rules.TemporaryFolder import java.io.File import java.nio.charset.Charset @@ -25,7 +22,7 @@ abstract class AbstractCoreTest { protected fun getTestDataDir(name: String) = File("src/test/resources/$name").takeIf { it.exists() }?.toPath() - ?: throw InvalidPathException(name, "Cannot be found") + ?: throw InvalidPathException(name, "Cannot be found") protected fun testFromData( configuration: DokkaConfigurationImpl, @@ -53,7 +50,8 @@ abstract class AbstractCoreTest { ) { val testMethods = TestBuilder().apply(block).build() val testDirPath = getTempDir(cleanupOutput).root.toPath() - val fileMap = query.toFileMap() + val fileMap = query//.replace("""\n\s*\n?""".toRegex(), "\n") + .replace("""\|/[^\w]""".toRegex()) { it.value.replace("|/", "| /") }.toFileMap() fileMap.materializeFiles(testDirPath.toAbsolutePath()) if (!cleanupOutput) logger.info("Output generated under: ${testDirPath.toAbsolutePath()}") |