diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/data/format/overloadsWithDescription.html | 3 | ||||
-rw-r--r-- | test/data/format/overloadsWithDifferentDescriptions.html | 2 | ||||
-rw-r--r-- | test/data/format/parameterAnchor.html | 17 | ||||
-rw-r--r-- | test/data/format/parameterAnchor.kt | 6 | ||||
-rw-r--r-- | test/src/TestAPI.kt | 3 | ||||
-rw-r--r-- | test/src/format/HtmlFormatTest.kt | 6 |
6 files changed, 35 insertions, 2 deletions
diff --git a/test/data/format/overloadsWithDescription.html b/test/data/format/overloadsWithDescription.html index b29ca658..db63b262 100644 --- a/test/data/format/overloadsWithDescription.html +++ b/test/data/format/overloadsWithDescription.html @@ -8,12 +8,13 @@ <h1>f</h1> <code><span class="keyword">fun </span><span class="identifier">f</span><span class="symbol">(</span><span class="identifier">x</span><span class="symbol">: </span><span class="identifier">Int</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/> <code><span class="keyword">fun </span><span class="identifier">f</span><span class="symbol">(</span><span class="identifier">x</span><span class="symbol">: </span><span class="identifier">String</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/> -<p>Performs an action on <a href="test/f/x">x</a>.</p> +<p>Performs an action on <a href="test/f#x">x</a>.</p> <h3>Description</h3> <p>This is a long description.</p> <br/> <br/> <h3>Parameters</h3> +<a name="x"></a> <code>x</code> - the value to perform the action on.<br/> <br/> <br/> diff --git a/test/data/format/overloadsWithDifferentDescriptions.html b/test/data/format/overloadsWithDifferentDescriptions.html index 66f8e9a6..06431d15 100644 --- a/test/data/format/overloadsWithDifferentDescriptions.html +++ b/test/data/format/overloadsWithDifferentDescriptions.html @@ -13,6 +13,7 @@ <br/> <br/> <h3>Parameters</h3> +<a name="x"></a> <code>x</code> - the int value to perform the action on.<br/> <br/> <br/> @@ -23,6 +24,7 @@ <br/> <br/> <h3>Parameters</h3> +<a name="x"></a> <code>x</code> - the string value to perform the action on.<br/> <br/> <br/> diff --git a/test/data/format/parameterAnchor.html b/test/data/format/parameterAnchor.html new file mode 100644 index 00000000..2b2fec08 --- /dev/null +++ b/test/data/format/parameterAnchor.html @@ -0,0 +1,17 @@ +<HTML> +<HEAD> +<title>test / processFiles</title> +</HEAD> +<BODY> +<a href="test/index">test</a> / <a href="test/process-files">processFiles</a><br/> +<br/> +<h1>processFiles</h1> +<code><span class="keyword">public</span> <span class="keyword">fun </span><span class="symbol"><</span><span class="identifier">T</span><span class="symbol">> </span><span class="identifier">processFiles</span><span class="symbol">(</span><span class="identifier">processor</span><span class="symbol">: </span><span class="symbol">(</span><span class="symbol">)</span> <span class="symbol">-></span> <span class="identifier">T</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">List</span><span class="symbol"><</span><span class="identifier">T</span><span class="symbol">></span></code><br/> +<p>Runs <a href="test/process-files#processor">processor</a> for each file and collects its results into single list</p> +<h3>Parameters</h3> +<a name="processor"></a> +<code>processor</code> - function to receive context for symbol resolution and file for processing<br/> +<br/> +<br/> +</BODY> +</HTML> diff --git a/test/data/format/parameterAnchor.kt b/test/data/format/parameterAnchor.kt new file mode 100644 index 00000000..ae36ee4c --- /dev/null +++ b/test/data/format/parameterAnchor.kt @@ -0,0 +1,6 @@ +/** + * Runs [processor] for each file and collects its results into single list + * @param processor function to receive context for symbol resolution and file for processing + */ +public fun processFiles<T>(processor: () -> T): List<T> { +} diff --git a/test/src/TestAPI.kt b/test/src/TestAPI.kt index 0b4c2084..285ffa28 100644 --- a/test/src/TestAPI.kt +++ b/test/src/TestAPI.kt @@ -100,7 +100,8 @@ fun ContentNode.toTestString(): String { } class InMemoryLocation(override val path: String): Location { - override fun relativePathTo(other: Location): String = other.path + override fun relativePathTo(other: Location, anchor: String?): String = + if (anchor != null) other.path + "#" + anchor else other.path } object InMemoryLocationService: LocationService { diff --git a/test/src/format/HtmlFormatTest.kt b/test/src/format/HtmlFormatTest.kt index 6fd7696a..9d4d30da 100644 --- a/test/src/format/HtmlFormatTest.kt +++ b/test/src/format/HtmlFormatTest.kt @@ -87,4 +87,10 @@ public class HtmlFormatTest { htmlService.appendNodes(tempLocation, output, model.members.single().members.filter { it.name == "Bar"} ) } } + + Test fun parameterAnchor() { + verifyOutput("test/data/format/parameterAnchor.kt", ".html") { model, output -> + htmlService.appendNodes(tempLocation, output, model.members.single().members) + } + } } |