diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/data/format/crossLanguage/kotlinExtendsJava.html | 26 | ||||
-rw-r--r-- | test/data/format/crossLanguage/kotlinExtendsJava/Bar.kt | 6 | ||||
-rw-r--r-- | test/data/format/crossLanguage/kotlinExtendsJava/test/Foo.java | 6 | ||||
-rw-r--r-- | test/src/TestAPI.kt | 4 | ||||
-rw-r--r-- | test/src/format/HtmlFormatTest.kt | 6 |
5 files changed, 47 insertions, 1 deletions
diff --git a/test/data/format/crossLanguage/kotlinExtendsJava.html b/test/data/format/crossLanguage/kotlinExtendsJava.html new file mode 100644 index 00000000..49a9ff8f --- /dev/null +++ b/test/data/format/crossLanguage/kotlinExtendsJava.html @@ -0,0 +1,26 @@ +<HTML> +<HEAD> +<title>test / test.Bar</title> +</HEAD> +<BODY> +<a href="test/index">test</a> / <a href="test/test/index">test</a> / <a href="test/test/-bar/index">Bar</a><br/> +<br/> +<h1>Bar</h1> +<code><span class="keyword">class </span><span class="identifier">Bar</span><span class="symbol"> : </span><a href="test/test/-foo/index"><span class="identifier">Foo</span></a></code><br/> +<p>See <a href="test/test/-foo/xyzzy">xyzzy</a></p> +<br/> +<br/> +<h3>Constructors</h3> +<table> +<tbody> +<tr> +<td> +<a href="test/test/-bar/-init-"><init></a></td> +<td> +<code><span class="keyword">public</span> <span class="identifier">Bar</span><span class="symbol">(</span><span class="symbol">)</span></code><p>See <a href="test/test/-foo/xyzzy">xyzzy</a></p> +</td> +</tr> +</tbody> +</table> +</BODY> +</HTML> diff --git a/test/data/format/crossLanguage/kotlinExtendsJava/Bar.kt b/test/data/format/crossLanguage/kotlinExtendsJava/Bar.kt new file mode 100644 index 00000000..102782f9 --- /dev/null +++ b/test/data/format/crossLanguage/kotlinExtendsJava/Bar.kt @@ -0,0 +1,6 @@ +package test + +/** + * See [xyzzy] + */ +class Bar(): Foo() diff --git a/test/data/format/crossLanguage/kotlinExtendsJava/test/Foo.java b/test/data/format/crossLanguage/kotlinExtendsJava/test/Foo.java new file mode 100644 index 00000000..7c143030 --- /dev/null +++ b/test/data/format/crossLanguage/kotlinExtendsJava/test/Foo.java @@ -0,0 +1,6 @@ +package test; + +public class Foo { + public void xyzzy() { + } +} diff --git a/test/src/TestAPI.kt b/test/src/TestAPI.kt index 7c6a2e73..6fc83279 100644 --- a/test/src/TestAPI.kt +++ b/test/src/TestAPI.kt @@ -30,6 +30,7 @@ public fun verifyModel(vararg files: String, verifier: (DocumentationModule) -> val stringRoot = PathManager.getResourceRoot(javaClass<String>(), "/java/lang/String.class") addClasspath(File(stringRoot)) addSources(files.toList()) + addClasspath(files.map { File(it)}.filter { it.isDirectory()} ) } val options = DocumentationOptions(includeNonPublic = true, sourceLinks = listOf<SourceLinkDefinition>()) val documentation = buildDocumentationModule(environment, "test", options, logger = DokkaConsoleLogger) @@ -48,7 +49,8 @@ public fun verifyOutput(path: String, outputExtension: String, outputGenerator: verifyModel(path) { val output = StringBuilder() outputGenerator(it, output) - val expectedOutput = File(path.replace(".kt", outputExtension).replace(".java", outputExtension)).readText() + val ext = outputExtension.trimLeading(".") + val expectedOutput = File(path.replaceAfterLast(".", ext, path + "." + ext)).readText() assertEqualsIgnoringSeparators(expectedOutput, output.toString()) } } diff --git a/test/src/format/HtmlFormatTest.kt b/test/src/format/HtmlFormatTest.kt index 85badf8e..c81b2d85 100644 --- a/test/src/format/HtmlFormatTest.kt +++ b/test/src/format/HtmlFormatTest.kt @@ -117,4 +117,10 @@ public class HtmlFormatTest { htmlService.appendNodes(tempLocation, output, model.members.single().members.single { it.name == "Foo" }.members.filter { it.name == "foo" }) } } + + Test fun crossLanguageKotlinExtendsJava() { + verifyOutput("test/data/format/crossLanguage/kotlinExtendsJava", ".html") { model, output -> + htmlService.appendNodes(tempLocation, output, model.members.single().members.filter { it.name == "Bar" }) + } + } } |