diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2017-03-02 10:43:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-02 10:43:07 +0100 |
commit | f2e05c2276cad276f1cc8b2cad393a1acee6ede8 (patch) | |
tree | 4f7ad1360c529cd116abf97a632f96f238ccef4a /test/scaladoc/run/shortDescription-annotation.scala | |
parent | 920bc4e31c5415d98c1a7f26aebc790250aafe4a (diff) | |
parent | e3c5df8ec369047d73a54ed94caebe0a4f26627c (diff) | |
download | scala-f2e05c2276cad276f1cc8b2cad393a1acee6ede8.tar.gz scala-f2e05c2276cad276f1cc8b2cad393a1acee6ede8.tar.bz2 scala-f2e05c2276cad276f1cc8b2cad393a1acee6ede8.zip |
Merge pull request #5728 from Philippus/issue/html-tag-in-hover
inlineToStr is not exhaustive and does not remove html tags inside HtmlTag [ci: last-only]
Diffstat (limited to 'test/scaladoc/run/shortDescription-annotation.scala')
-rw-r--r-- | test/scaladoc/run/shortDescription-annotation.scala | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/test/scaladoc/run/shortDescription-annotation.scala b/test/scaladoc/run/shortDescription-annotation.scala index 0e2950f4f9..4f9a891133 100644 --- a/test/scaladoc/run/shortDescription-annotation.scala +++ b/test/scaladoc/run/shortDescription-annotation.scala @@ -1,3 +1,4 @@ +import scala.tools.nsc.doc.html.Page import scala.tools.nsc.doc.model._ import scala.tools.partest.ScaladocModelTest @@ -26,30 +27,18 @@ object Test extends ScaladocModelTest { import scala.tools.nsc.doc.base.comment._ import access._ - def inlineToStr(inl: Inline): String = inl match { - case Chain(items) => items flatMap (inlineToStr(_)) mkString "" - case Italic(in) => inlineToStr(in) - case Bold(in) => inlineToStr(in) - case Underline(in) => inlineToStr(in) - case Monospace(in) => inlineToStr(in) - case Text(text) => text - case Summary(in) => inlineToStr(in) - case EntityLink(Text(text), _) => text - case _ => inl.toString - } - val foo = rootPackage._package("a")._class("Foo") // Assert that the class has the correct short description - val classDesc = inlineToStr(foo.comment.get.short) + val classDesc = Page.inlineToStr(foo.comment.get.short) assert(classDesc == "This one should appear", classDesc) // Assert that the `foo` method has the correct short description - val fooDesc = inlineToStr(foo._method("foo").comment.get.short) + val fooDesc = Page.inlineToStr(foo._method("foo").comment.get.short) assert(fooDesc == "This comment should appear", fooDesc) // Assert that the `goo` method has the correct short description - val gooDesc = inlineToStr(foo._method("goo").comment.get.short) + val gooDesc = Page.inlineToStr(foo._method("goo").comment.get.short) assert(gooDesc == "This comment should appear", gooDesc) } } |