From 85a3ae7626810113816fd31a0e26d44d48308ed2 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 20 Feb 2015 14:08:30 +0100 Subject: support in-page anchors in locations --- test/src/TestAPI.kt | 3 ++- test/src/format/HtmlFormatTest.kt | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'test/src') 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) + } + } } -- cgit