summaryrefslogtreecommitdiff
path: root/test/scaladoc
diff options
context:
space:
mode:
authorVlad Ureche <vlad.ureche@gmail.com>2012-03-20 15:17:22 +0100
committerVlad Ureche <vlad.ureche@gmail.com>2012-03-20 15:17:22 +0100
commit81e3121eb09010375783d13e8c4c853686a34ffd (patch)
treedae6d74ff76823c53a32b0f9095f5e2fd77a7867 /test/scaladoc
parent7c5c06f5f421453c46972d079d0eab5550d848fc (diff)
parent75ef45161d0599e43c33cbba8d253088bdfa9a79 (diff)
downloadscala-81e3121eb09010375783d13e8c4c853686a34ffd.tar.gz
scala-81e3121eb09010375783d13e8c4c853686a34ffd.tar.bz2
scala-81e3121eb09010375783d13e8c4c853686a34ffd.zip
Merge branch 'issue/5054-usecase-cleanup'
Conflicts: test/scaladoc/scala/html/HtmlFactoryTest.scala
Diffstat (limited to 'test/scaladoc')
-rw-r--r--test/scaladoc/resources/code-indent.scala37
-rw-r--r--test/scaladoc/scala/html/HtmlFactoryTest.scala17
2 files changed, 54 insertions, 0 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 67358e6e70..7550faa536 100644
--- a/test/scaladoc/scala/html/HtmlFactoryTest.scala
+++ b/test/scaladoc/scala/html/HtmlFactoryTest.scala
@@ -671,6 +671,23 @@ object Test extends Properties("HtmlFactory") {
// traits E, F and H shouldn't crash scaladoc but we don't need to check the output
)
+ 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)