diff options
author | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2018-01-19 01:04:25 +0300 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2018-01-19 01:04:25 +0300 |
commit | e4e5030d33551bdb03ab03a840bb2e70690d383e (patch) | |
tree | d1f5169b2ca538ce08dff09971db8ebf30b812a7 /core/src/test/kotlin/format | |
parent | 9d55720133cdc40e53df4b7a6592fc0fcbf6c8eb (diff) | |
download | dokka-e4e5030d33551bdb03ab03a840bb2e70690d383e.tar.gz |
Support extensions on external classes correctly
Diffstat (limited to 'core/src/test/kotlin/format')
-rw-r--r-- | core/src/test/kotlin/format/JavaLayoutHtmlFormatTest.kt | 12 | ||||
-rw-r--r-- | core/src/test/kotlin/format/JavaLayoutHtmlFormatTestCase.kt | 12 |
2 files changed, 19 insertions, 5 deletions
diff --git a/core/src/test/kotlin/format/JavaLayoutHtmlFormatTest.kt b/core/src/test/kotlin/format/JavaLayoutHtmlFormatTest.kt index d32ce5ee6..7a16df516 100644 --- a/core/src/test/kotlin/format/JavaLayoutHtmlFormatTest.kt +++ b/core/src/test/kotlin/format/JavaLayoutHtmlFormatTest.kt @@ -22,4 +22,16 @@ class JavaLayoutHtmlFormatTest : JavaLayoutHtmlFormatTestCase() { listOf(model.members.single().members.single { it.name == "foo" }) } } + + @Test + fun externalClassExtension() { + verifyPackageNode("externalClassExtension.kt") + } + + @Test + fun unresolvedExternalClass() { + verifyNode("unresolvedExternalClass.kt", noStdlibLink = true) { model -> + listOf(model.members.single().members.single { it.name == "MyException" }) + } + } }
\ No newline at end of file diff --git a/core/src/test/kotlin/format/JavaLayoutHtmlFormatTestCase.kt b/core/src/test/kotlin/format/JavaLayoutHtmlFormatTestCase.kt index dcdd6128a..260ca9974 100644 --- a/core/src/test/kotlin/format/JavaLayoutHtmlFormatTestCase.kt +++ b/core/src/test/kotlin/format/JavaLayoutHtmlFormatTestCase.kt @@ -70,13 +70,13 @@ abstract class JavaLayoutHtmlFormatTestCase { } } - protected fun verifyNode(fileName: String, select: (model: DocumentationNode) -> List<DocumentationNode>) { + protected fun verifyNode(fileName: String, noStdlibLink: Boolean = false, select: (model: DocumentationNode) -> List<DocumentationNode>) { verifyOutput( "testdata/format/java-layout-html/$fileName", ".html", format = "java-layout-html", withKotlinRuntime = true, - noStdlibLink = false, + noStdlibLink = noStdlibLink, collectInheritedExtensionsFromLibraries = true ) { model, output -> buildPagesAndReadInto( @@ -88,14 +88,16 @@ abstract class JavaLayoutHtmlFormatTestCase { } protected fun verifyNode(fileName: String) { - verifyNode(fileName, { model -> listOf(model.members.single().members.single()) }) + verifyNode(fileName) { model -> listOf(model.members.single().members.single()) } } - protected fun verifyPackageNode(fileName: String) { + protected fun verifyPackageNode(fileName: String, noStdlibLink: Boolean = false) { verifyOutput( "testdata/format/java-layout-html/$fileName", ".package-summary.html", - format = "java-layout-html" + format = "java-layout-html", + withKotlinRuntime = true, + noStdlibLink = noStdlibLink ) { model, output -> buildPagesAndReadInto( model, |