diff options
author | Kato Kazuyoshi <kato.kazuyoshi@gmail.com> | 2011-04-15 16:12:22 +0000 |
---|---|---|
committer | Kato Kazuyoshi <kato.kazuyoshi@gmail.com> | 2011-04-15 16:12:22 +0000 |
commit | ed52bec270e9ac659638f10c05d1d0efedf4c5cc (patch) | |
tree | b1836ad9cac670bbab41fecbe6a15f9f43293768 /test/scaladoc | |
parent | 3c8bc3ab731206f93ad8428b11276237d1397a08 (diff) | |
download | scala-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')
-rw-r--r-- | test/scaladoc/resources/Trac4471.scala | 9 | ||||
-rw-r--r-- | test/scaladoc/scala/html/HtmlFactoryTest.scala | 32 |
2 files changed, 41 insertions, 0 deletions
diff --git a/test/scaladoc/resources/Trac4471.scala b/test/scaladoc/resources/Trac4471.scala new file mode 100644 index 0000000000..2a22887c0d --- /dev/null +++ b/test/scaladoc/resources/Trac4471.scala @@ -0,0 +1,9 @@ +class A { + @deprecated def foo = 123 + @deprecated def bar = 456 +} + +class B { + def foo = 123 + @deprecated def bar = 456 +} 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 + } + } } |