diff options
Diffstat (limited to 'test/scaladoc')
-rw-r--r-- | test/scaladoc/resources/SI-4014_0.scala | 4 | ||||
-rw-r--r-- | test/scaladoc/resources/SI-4014_1.scala | 5 | ||||
-rw-r--r-- | test/scaladoc/resources/SI-4014_2.scala | 6 | ||||
-rw-r--r-- | test/scaladoc/run/t7124.check | 3 | ||||
-rw-r--r-- | test/scaladoc/run/t7124.scala | 22 | ||||
-rw-r--r-- | test/scaladoc/scalacheck/HtmlFactoryTest.scala | 46 |
6 files changed, 84 insertions, 2 deletions
diff --git a/test/scaladoc/resources/SI-4014_0.scala b/test/scaladoc/resources/SI-4014_0.scala new file mode 100644 index 0000000000..c398fcc1e0 --- /dev/null +++ b/test/scaladoc/resources/SI-4014_0.scala @@ -0,0 +1,4 @@ +/** A template without authors. + * + */ +trait Foo
\ No newline at end of file diff --git a/test/scaladoc/resources/SI-4014_1.scala b/test/scaladoc/resources/SI-4014_1.scala new file mode 100644 index 0000000000..34386b515e --- /dev/null +++ b/test/scaladoc/resources/SI-4014_1.scala @@ -0,0 +1,5 @@ +/** A template with one author. + * + * @author The Only Author + */ +trait Foo
\ No newline at end of file diff --git a/test/scaladoc/resources/SI-4014_2.scala b/test/scaladoc/resources/SI-4014_2.scala new file mode 100644 index 0000000000..514f7a1e4c --- /dev/null +++ b/test/scaladoc/resources/SI-4014_2.scala @@ -0,0 +1,6 @@ +/** A template with more than one author. + * + * @author The First Author + * @author The Second Author + */ +trait Foo
\ No newline at end of file diff --git a/test/scaladoc/run/t7124.check b/test/scaladoc/run/t7124.check new file mode 100644 index 0000000000..96b627a322 --- /dev/null +++ b/test/scaladoc/run/t7124.check @@ -0,0 +1,3 @@ +List() +List(Paragraph(Text(macro))) +Done. diff --git a/test/scaladoc/run/t7124.scala b/test/scaladoc/run/t7124.scala new file mode 100644 index 0000000000..e8272000d2 --- /dev/null +++ b/test/scaladoc/run/t7124.scala @@ -0,0 +1,22 @@ +import scala.tools.nsc.doc.model._ +import scala.tools.partest.ScaladocModelTest + +object Test extends ScaladocModelTest { + + override def code = """ + import scala.language.experimental.macros + class Test { + def print(): Unit = macro ??? + } + """ + + def scaladocSettings = "" + + def testModel(root: Package) = { + import access._ + val p = root._class("Test")._method("print") + + println(p.annotations) // no annotations + println(p.flags) // a 'macro' flag + } +} diff --git a/test/scaladoc/scalacheck/HtmlFactoryTest.scala b/test/scaladoc/scalacheck/HtmlFactoryTest.scala index 03348b81d2..56328ea875 100644 --- a/test/scaladoc/scalacheck/HtmlFactoryTest.scala +++ b/test/scaladoc/scalacheck/HtmlFactoryTest.scala @@ -47,6 +47,7 @@ object Test extends Properties("HtmlFactory") { settings.scaladocQuietRun = true settings.nowarn.value = true settings.classpath.value = getClasspath + settings.docAuthor.value = true val reporter = new scala.tools.nsc.reporters.ConsoleReporter(settings) new DocFactory(reporter, settings) @@ -563,12 +564,13 @@ object Test extends Properties("HtmlFactory") { property("Comment inheritance: Correct explicit inheritance for override") = checkText("explicit-inheritance-override.scala")( (Some("InheritDocDerived"), - """def function[T](arg1: T, arg2: String): Double + """def function[T](arg1: T, arg2: String): Double Starting line Starting line The base comment. And another sentence... The base comment. And another sentence... Ending line + Author: StartAuthor a Scala developer EndAuthor T StartT the type of the first argument EndT arg1 Start1 The T term comment End1 arg2 Start2 The string comment End2 @@ -589,12 +591,13 @@ object Test extends Properties("HtmlFactory") { property("Comment inheritance: Correct explicit inheritance for usecase") = checkText("explicit-inheritance-usecase.scala")( (Some("UseCaseInheritDoc"), - """def function[T](arg1: T, arg2: String): Double + """def function[T](arg1: T, arg2: String): Double [use case] Starting line [use case] Starting line The base comment. And another sentence... The base comment. And another sentence... Ending line + Author: StartAuthor a Scala developer EndAuthor T StartT the type of the first argument EndT arg1 Start1 The T term comment End1 arg2 Start2 The string comment End2 @@ -663,6 +666,45 @@ object Test extends Properties("HtmlFactory") { } } + property("SI-4014: Scaladoc omits @author: no authors") = { + val noAuthors = createTemplates("SI-4014_0.scala")("Foo.html") + + noAuthors match { + case node: scala.xml.Node => { + val s = node.toString + ! s.contains("Author") + } + case _ => false + } + } + + property("SI-4014: Scaladoc omits @author: one author") = { + val oneAuthor = createTemplates("SI-4014_1.scala")("Foo.html") + + oneAuthor match { + case node: scala.xml.Node => { + val s = node.toString + s.contains("<h6>Author:</h6>") + s.contains("<p>The Only Author\n</p>") + } + case _ => false + } + } + + property("SI-4014: Scaladoc omits @author: two authors") = { + val twoAuthors = createTemplates("SI-4014_2.scala")("Foo.html") + + twoAuthors match { + case node: scala.xml.Node => { + val s = node.toString + s.contains("<h6>Authors:</h6>") + s.contains("<p>The First Author\n</p>") + s.contains("<p>The Second Author\n</p>") + } + case _ => false + } + } + { val files = createTemplates("basic.scala") //println(files) |