aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/data/format/htmlEscaping.html12
-rw-r--r--test/data/format/htmlEscaping.kt4
-rw-r--r--test/src/format/HtmlFormatTest.kt6
3 files changed, 22 insertions, 0 deletions
diff --git a/test/data/format/htmlEscaping.html b/test/data/format/htmlEscaping.html
new file mode 100644
index 00000000..4f1409c4
--- /dev/null
+++ b/test/data/format/htmlEscaping.html
@@ -0,0 +1,12 @@
+<HTML>
+<HEAD>
+</HEAD>
+<BODY>
+<a href="out.html">test</a>&nbsp;/&nbsp;<a href="out.html"></a>&nbsp;/&nbsp;<a href="out.html">x</a><br/>
+<br/>
+<h1>x</h1>
+<pre><code><span class="keyword">fun </span><span class="symbol">&lt;</span><span class="identifier">T</span><span class="symbol">&gt; </span><span class="identifier">x</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">T?</span></code></pre><p>Special characters: &lt; is "less than", &gt; is "greater than", &amp; is "ampersand"</p>
+<br/>
+<br/>
+</BODY>
+</HTML>
diff --git a/test/data/format/htmlEscaping.kt b/test/data/format/htmlEscaping.kt
new file mode 100644
index 00000000..8778d8a5
--- /dev/null
+++ b/test/data/format/htmlEscaping.kt
@@ -0,0 +1,4 @@
+/**
+ * Special characters: < is "less than", > is "greater than", & is "ampersand"
+ */
+fun x<T>(): T? = null
diff --git a/test/src/format/HtmlFormatTest.kt b/test/src/format/HtmlFormatTest.kt
index 758c6e7b..a47b5774 100644
--- a/test/src/format/HtmlFormatTest.kt
+++ b/test/src/format/HtmlFormatTest.kt
@@ -12,4 +12,10 @@ public class HtmlFormatTest {
htmlService.appendNodes(tempLocation, output, model.members.single().members)
}
}
+
+ Test fun htmlEscaping() {
+ verifyOutput("test/data/format/htmlEscaping.kt", ".html") { model, output ->
+ htmlService.appendNodes(tempLocation, output, model.members.single().members)
+ }
+ }
}