summaryrefslogtreecommitdiff
path: root/test/scaladoc/scala/html/HtmlFactoryTest.scala
diff options
context:
space:
mode:
authorKato Kazuyoshi <kato.kazuyoshi@gmail.com>2011-04-15 16:12:22 +0000
committerKato Kazuyoshi <kato.kazuyoshi@gmail.com>2011-04-15 16:12:22 +0000
commited52bec270e9ac659638f10c05d1d0efedf4c5cc (patch)
treeb1836ad9cac670bbab41fecbe6a15f9f43293768 /test/scaladoc/scala/html/HtmlFactoryTest.scala
parent3c8bc3ab731206f93ad8428b11276237d1397a08 (diff)
downloadscala-ed52bec270e9ac659638f10c05d1d0efedf4c5cc.tar.gz
scala-ed52bec270e9ac659638f10c05d1d0efedf4c5cc.tar.bz2
scala-ed52bec270e9ac659638f10c05d1d0efedf4c5cc.zip
[scaladoc] Strike-through for deprecated symbol...
[scaladoc] Strike-through for deprecated symbols on the reference index. Closes #4471. Review by dubochet.
Diffstat (limited to 'test/scaladoc/scala/html/HtmlFactoryTest.scala')
-rw-r--r--test/scaladoc/scala/html/HtmlFactoryTest.scala32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/scaladoc/scala/html/HtmlFactoryTest.scala b/test/scaladoc/scala/html/HtmlFactoryTest.scala
index 15f5249c90..cb31df3fb2 100644
--- a/test/scaladoc/scala/html/HtmlFactoryTest.scala
+++ b/test/scaladoc/scala/html/HtmlFactoryTest.scala
@@ -24,6 +24,7 @@ object Test extends Properties("HtmlFactory") {
import scala.tools.nsc.doc.{DocFactory, Settings}
import scala.tools.nsc.doc.model.IndexModelFactory
import scala.tools.nsc.doc.html.HtmlFactory
+ import scala.tools.nsc.doc.html.page.ReferenceIndex
def getClasspath = {
// these things can be tricky
@@ -59,6 +60,23 @@ object Test extends Properties("HtmlFactory") {
result
}
+ def createReferenceIndex(basename: String) = {
+ createFactory.makeUniverse(List("test/scaladoc/resources/"+basename)) match {
+ case Some(universe) => {
+ val index = IndexModelFactory.makeIndex(universe)
+ val pages = index.firstLetterIndex.map({
+ case (key, value) => {
+ val page = new ReferenceIndex(key, index, universe)
+ page.absoluteLinkTo(page.path) -> page.body
+ }
+ })
+ Some(pages)
+ }
+ case _ =>
+ None
+ }
+ }
+
def createTemplate(scala: String) = {
val html = scala.stripSuffix(".scala") + ".html"
createTemplates(scala)(html)
@@ -274,4 +292,18 @@ object Test extends Properties("HtmlFactory") {
case _ => false
}
}
+
+ property("Trac #4471") = {
+ createReferenceIndex("Trac4471.scala") match {
+ case Some(pages) =>
+ (pages.get("index/index-f.html") match {
+ case Some(node) => node.toString.contains(">A</a></strike>")
+ case _ => false
+ }) && (pages.get("index/index-b.html") match {
+ case Some(node) => node.toString.contains(">bar</strike>")
+ case _ => false
+ })
+ case _ => false
+ }
+ }
}