summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorVlad Ureche <vlad.ureche@gmail.com>2012-03-20 01:20:52 +0100
committerVlad Ureche <vlad.ureche@gmail.com>2012-03-20 01:20:52 +0100
commitc7d852558302c5c4abc2eadacf42d51d5050c7f2 (patch)
treef39882e67e3eb443bade2b2fb13a76d2141108d4 /test
parentbc7bf663f2df564805fa5121de7b0006cf2149f2 (diff)
downloadscala-c7d852558302c5c4abc2eadacf42d51d5050c7f2.tar.gz
scala-c7d852558302c5c4abc2eadacf42d51d5050c7f2.tar.bz2
scala-c7d852558302c5c4abc2eadacf42d51d5050c7f2.zip
Adapted indentation in scaladoc code blocks
and fixed a pesky crash in the syntax highlighting caused by invalid chars (0x0E) in MarkupParser.scala.
Diffstat (limited to 'test')
-rw-r--r--test/scaladoc/resources/code-indent.scala37
-rw-r--r--test/scaladoc/scala/html/HtmlFactoryTest.scala19
2 files changed, 55 insertions, 1 deletions
diff --git a/test/scaladoc/resources/code-indent.scala b/test/scaladoc/resources/code-indent.scala
new file mode 100644
index 0000000000..88946ffc7f
--- /dev/null
+++ b/test/scaladoc/resources/code-indent.scala
@@ -0,0 +1,37 @@
+/**
+ * This is an example of indented comments:
+ * {{{
+ * a typicial indented
+ * comment on multiple
+ * comment lines
+ * }}}
+ * {{{ one liner }}}
+ * {{{ two lines, one useful
+ * }}}
+ * {{{
+ * line1
+ * line2
+ * line3
+ * line4}}}
+ * {{{
+ * a ragged example
+ * a (condition)
+ * the t h e n branch
+ * an alternative
+ * the e l s e branch
+ * }}}
+ * NB: Trailing spaces are necessary for this test!
+ * {{{
+ * l1
+ *
+ * l2
+ *
+ * l3
+ *
+ * l4
+ *
+ * l5
+ * }}}
+
+ */
+class C
diff --git a/test/scaladoc/scala/html/HtmlFactoryTest.scala b/test/scaladoc/scala/html/HtmlFactoryTest.scala
index d46a9581b9..818230238d 100644
--- a/test/scaladoc/scala/html/HtmlFactoryTest.scala
+++ b/test/scaladoc/scala/html/HtmlFactoryTest.scala
@@ -580,7 +580,24 @@ object Test extends Properties("HtmlFactory") {
""", true)
)
}
-
+
+ property("Indentation normalization for code blocks") = {
+ val files = createTemplates("code-indent.scala")
+
+ files("C.html") match {
+ case node: scala.xml.Node => {
+ val s = node.toString
+ s.contains("<pre>a typicial indented\ncomment on multiple\ncomment lines</pre>") &&
+ s.contains("<pre>one liner</pre>") &&
+ s.contains("<pre>two lines, one useful</pre>") &&
+ s.contains("<pre>line1\nline2\nline3\nline4</pre>") &&
+ s.contains("<pre>a ragged example\na (condition)\n the t h e n branch\nan alternative\n the e l s e branch</pre>") &&
+ s.contains("<pre>l1\n\nl2\n\nl3\n\nl4\n\nl5</pre>")
+ }
+ case _ => false
+ }
+ }
+
{
val files = createTemplates("basic.scala")
//println(files)