diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/data/format/javaSupertype.html | 13 | ||||
-rw-r--r-- | test/data/format/javaSupertype.java | 9 | ||||
-rw-r--r-- | test/src/TestAPI.kt | 2 | ||||
-rw-r--r-- | test/src/format/HtmlFormatTest.kt | 6 |
4 files changed, 29 insertions, 1 deletions
diff --git a/test/data/format/javaSupertype.html b/test/data/format/javaSupertype.html new file mode 100644 index 00000000..bf56936c --- /dev/null +++ b/test/data/format/javaSupertype.html @@ -0,0 +1,13 @@ +<HTML> +<HEAD> +<title>test / test.C.Bar</title> +</HEAD> +<BODY> +<a href="test/index">test</a> / <a href="test/test/index">test</a> / <a href="test/test/-c/index">C</a> / <a href="test/test/-c/-bar">Bar</a><br/> +<br/> +<h1>Bar</h1> +<code><span class="keyword">public</span> <span class="keyword">open</span> <span class="keyword">class </span><span class="identifier">Bar</span><span class="symbol"> : </span><a href="test/test/-c/-foo"><span class="identifier">Foo</span></a></code><br/> +<br/> +<br/> +</BODY> +</HTML> diff --git a/test/data/format/javaSupertype.java b/test/data/format/javaSupertype.java new file mode 100644 index 00000000..96caeb1d --- /dev/null +++ b/test/data/format/javaSupertype.java @@ -0,0 +1,9 @@ +package test; + +class C { + public static class Foo { + } + + public static class Bar extends Foo { + } +} diff --git a/test/src/TestAPI.kt b/test/src/TestAPI.kt index 33688053..7c6a2e73 100644 --- a/test/src/TestAPI.kt +++ b/test/src/TestAPI.kt @@ -48,7 +48,7 @@ public fun verifyOutput(path: String, outputExtension: String, outputGenerator: verifyModel(path) { val output = StringBuilder() outputGenerator(it, output) - val expectedOutput = File(path.replace(".kt", outputExtension)).readText() + val expectedOutput = File(path.replace(".kt", outputExtension).replace(".java", outputExtension)).readText() assertEqualsIgnoringSeparators(expectedOutput, output.toString()) } } diff --git a/test/src/format/HtmlFormatTest.kt b/test/src/format/HtmlFormatTest.kt index 9d4d30da..f6e0a2f3 100644 --- a/test/src/format/HtmlFormatTest.kt +++ b/test/src/format/HtmlFormatTest.kt @@ -93,4 +93,10 @@ public class HtmlFormatTest { htmlService.appendNodes(tempLocation, output, model.members.single().members) } } + + Test fun javaSupertypeLink() { + verifyOutput("test/data/format/javaSupertype.java", ".html") { model, output -> + htmlService.appendNodes(tempLocation, output, model.members.single().members.single { it.name == "C"}.members.filter { it.name == "Bar"} ) + } + } } |