diff options
author | Kato Kazuyoshi <kato.kazuyoshi@gmail.com> | 2011-03-25 22:55:19 +0000 |
---|---|---|
committer | Kato Kazuyoshi <kato.kazuyoshi@gmail.com> | 2011-03-25 22:55:19 +0000 |
commit | c402bdde2ecdbc1f63e90a603263e722ffee7202 (patch) | |
tree | 46caa318ca3ad4e9343de3beabd0dfa02dc245d7 /test | |
parent | 22d1ae7fa498df9ca80a686ca28ce5f816b6f945 (diff) | |
download | scala-c402bdde2ecdbc1f63e90a603263e722ffee7202.tar.gz scala-c402bdde2ecdbc1f63e90a603263e722ffee7202.tar.bz2 scala-c402bdde2ecdbc1f63e90a603263e722ffee7202.zip |
[scaladoc] Stop wiki syntax parsing inside HTML.
Diffstat (limited to 'test')
-rw-r--r-- | test/scaladoc/resources/Trac4358.scala | 8 | ||||
-rw-r--r-- | test/scaladoc/scala/html/HtmlFactoryTest.scala | 20 | ||||
-rw-r--r-- | test/scaladoc/scala/model/CommentFactoryTest.scala | 43 |
3 files changed, 63 insertions, 8 deletions
diff --git a/test/scaladoc/resources/Trac4358.scala b/test/scaladoc/resources/Trac4358.scala new file mode 100644 index 0000000000..39eee3d47e --- /dev/null +++ b/test/scaladoc/resources/Trac4358.scala @@ -0,0 +1,8 @@ +trait EasyMockSugar { + /** + * Implicit conversion that invokes the <code>expect</code> method on the <code>EasyMock</code> companion object (<em>i.e.</em>, the + * static <code>expect</code> method in Java class <code>org.easymock.EasyMock</code>). + * + */ + val foo = 123 +} diff --git a/test/scaladoc/scala/html/HtmlFactoryTest.scala b/test/scaladoc/scala/html/HtmlFactoryTest.scala index ecdbb3cf46..da77aed7da 100644 --- a/test/scaladoc/scala/html/HtmlFactoryTest.scala +++ b/test/scaladoc/scala/html/HtmlFactoryTest.scala @@ -124,4 +124,24 @@ object Test extends Properties("HtmlFactory") { case _ => false } } + + property("Trac #4358") = { + val files = createTemplates("Trac4358.scala") + files("EasyMockSugar.html") match { + case node: scala.xml.Node => { + val comments = XMLUtil.stripGroup(node).descendant.flatMap { + case e: scala.xml.Elem => { + if (e.attribute("class").toString.contains("shortcomment")) { + Some(e) + } else { + None + } + } + case _ => None + } + ! comments.exists { _.toString.contains("<em>i.</em>") } + } + case _ => false + } + } } diff --git a/test/scaladoc/scala/model/CommentFactoryTest.scala b/test/scaladoc/scala/model/CommentFactoryTest.scala index 25a91b1fa2..9f60d2a1b7 100644 --- a/test/scaladoc/scala/model/CommentFactoryTest.scala +++ b/test/scaladoc/scala/model/CommentFactoryTest.scala @@ -92,11 +92,9 @@ object Test extends Properties("CommentFactory") { * */""", Chain(List(Text(""), Text("\n"), - HtmlTag("<pre>"), Text("\n"), - Text("hello "), Chain(List(Text("^"), - Chain(List(Text("world"), - Text("\n"), - HtmlTag("</pre>"))))))) + + + HtmlTag("<pre>\nhello ^world\n</pre>"))) ) property("Trac #4366 - body") = { @@ -109,8 +107,7 @@ object Test extends Properties("CommentFactory") { ) body == Body(List(Paragraph(Chain(List( - Summary(Chain(List(Chain(List(HtmlTag("<strong>"), HtmlTag("<code>foo</code>"), Text(" has been deprecated and will be removed in a future version"))), Text(".")))), - Chain(List(Text(" Please call "), HtmlTag("<code>bar</code>"), Text(" instead."), HtmlTag("</strong>"), Text("\n"), Text(""))) + Summary(Chain(List(HtmlTag("<strong><code>foo</code> has been deprecated and will be removed in a future version. Please call <code>bar</code> instead.</strong>"), Text("\n"), Text("")))) ))))) } @@ -122,7 +119,37 @@ object Test extends Properties("CommentFactory") { */ """ ) + body.summary == Some(Chain(List(HtmlTag("<strong><code>foo</code> has been deprecated and will be removed in a future version. Please call <code>bar</code> instead.</strong>"), Text("\n"), Text("")))) + } - body.summary == Some(Chain(List(Chain(List(HtmlTag("<strong>"), HtmlTag("<code>foo</code>"), Text(" has been deprecated and will be removed in a future version"))), Text(".")))) + property("Trac #4358 - body") = { + factory.createBody( + """ + /** + * Implicit conversion that invokes the <code>expect</code> method on the <code>EasyMock</code> companion object (<em>i.e.</em>, the + * static <code>expect</code> method in Java class <code>org.easymock.EasyMock</code>). + */ + """ + ) match { + case Body(List(Paragraph(Chain(List(Summary(Chain(List(Chain(List( + Text("Implicit conversion that invokes the "), + HtmlTag("<code>expect</code>"), + Text(" method on the "), + HtmlTag("<code>EasyMock</code>"), + Text(" companion object ("), + HtmlTag("<em>i.e.</em>"), + Text(", the\nstatic "), + HtmlTag("<code>expect</code>"), + Text(" method in Java class "), + HtmlTag("<code>org.easymock.EasyMock</code>"), + Text(")") + )), Text(".")))), Text("\n")))))) => + true + case other => { + println(other) + false + } + } } + } |