summaryrefslogtreecommitdiff
path: root/test/scaladoc/model
diff options
context:
space:
mode:
authorKato Kazuyoshi <kato.kazuyoshi@gmail.com>2011-03-21 12:24:48 +0000
committerKato Kazuyoshi <kato.kazuyoshi@gmail.com>2011-03-21 12:24:48 +0000
commit4d0cd60b0e2b9071bba2641da95c75332458193b (patch)
tree7e21eec8d5716797bd2b27b37668ab29ca255e9b /test/scaladoc/model
parent72a0e8be61df92b15c9991d023b783e019a58916 (diff)
downloadscala-4d0cd60b0e2b9071bba2641da95c75332458193b.tar.gz
scala-4d0cd60b0e2b9071bba2641da95c75332458193b.tar.bz2
scala-4d0cd60b0e2b9071bba2641da95c75332458193b.zip
[scaladoc] Add HtmlFactoryTest and reorganize d...
[scaladoc] Add HtmlFactoryTest and reorganize directory structure. Reviewed by pedrofurla.
Diffstat (limited to 'test/scaladoc/model')
-rw-r--r--test/scaladoc/model/CommentFactoryTest.scala76
1 files changed, 0 insertions, 76 deletions
diff --git a/test/scaladoc/model/CommentFactoryTest.scala b/test/scaladoc/model/CommentFactoryTest.scala
deleted file mode 100644
index 204baaa05b..0000000000
--- a/test/scaladoc/model/CommentFactoryTest.scala
+++ /dev/null
@@ -1,76 +0,0 @@
-import org.scalacheck._
-import org.scalacheck.Prop._
-
-import scala.tools.nsc.Global
-import scala.tools.nsc.doc
-import scala.tools.nsc.doc.model.comment._
-
-class Factory(val g: Global, val s: doc.Settings)
- extends doc.model.ModelFactory(g, s) {
- thisFactory: Factory with CommentFactory with doc.model.TreeFactory =>
-
- def strip(c: Comment): Option[Inline] = {
- c.body match {
- case Body(List(Paragraph(Chain(List(Summary(inner)))))) => Some(inner)
- case _ => None
- }
- }
-
- def parseComment(s: String): Option[Inline] =
- strip(parse(s, "", scala.tools.nsc.util.NoPosition))
-}
-
-object Test extends Properties("CommentFactory") {
- val factory = {
- val settings = new doc.Settings((str: String) => {})
- val reporter = new scala.tools.nsc.reporters.ConsoleReporter(settings)
- val g = new Global(settings, reporter)
- (new Factory(g, settings) with CommentFactory with doc.model.TreeFactory)
- }
-
- def parse(src: String, dst: Inline) = {
- factory.parseComment(src) match {
- case Some(inline) =>
- inline == dst
- case _ =>
- false
- }
- }
-
- property("parse") = parse(
- "/** One two three */",
- Text("One two three")
- )
- property("parse") = parse(
- "/** One `two` three */",
- Chain(List(Text("One "), Monospace("two"), Text(" three")))
- )
-
- property("parse") = parse(
- """
-/** One two
- * three */""",
- Text("One two\nthree")
- )
- property("parse") = parse(
- """
-/** One `two`
- * three */""",
- Chain(List(Text("One "), Monospace("two"), Text("\n"), Text("three")))
- )
-
- property("parse") = parse(
- """
-/** One `two`
- * three */""",
- Chain(List(Text("One "), Monospace("two"), Text("\n"), Text(" three")))
- )
-
- property("parse") = parse(
- """
-/** One
- * `two` three */""",
- Chain(List(Text("One"), Text("\n"), Monospace("two"), Text(" three")))
- )
-
-}