summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.xml5
-rw-r--r--test/scaladoc/resources/basic.scala20
-rw-r--r--test/scaladoc/scala/html/HtmlFactoryTest.scala31
3 files changed, 54 insertions, 2 deletions
diff --git a/build.xml b/build.xml
index 697a98820f..7e2167dc57 100644
--- a/build.xml
+++ b/build.xml
@@ -1602,12 +1602,13 @@ BOOTRAPING TEST AND TEST SUITE
</target>
<target name="test.scaladoc" depends="pack.done">
- <partest erroronfailed="yes" scalacopts="${scalac.args.optimise}">
+ <partest erroronfailed="yes" scalacopts="${scalac.args.optimise}"
+ showlog="yes">
<compilationpath>
<path refid="pack.classpath"/>
</compilationpath>
<scalachecktests dir="test/scaladoc/scala">
- <include name="*.scala"/>
+ <include name="**/*.scala"/>
</scalachecktests>
</partest>
</target>
diff --git a/test/scaladoc/resources/basic.scala b/test/scaladoc/resources/basic.scala
new file mode 100644
index 0000000000..8645efd818
--- /dev/null
+++ b/test/scaladoc/resources/basic.scala
@@ -0,0 +1,20 @@
+package com.example {
+ package object p1 {
+ def packageObjectMethod = 0
+ }
+}
+
+package com.example.p1 {
+ class Clazz {
+ def foo = packageObjectMethod
+ implicit def intToClass1(n: Int) = new Clazz
+ }
+
+ class UpperBound[T <: Int]
+
+ class LowerBound[T >: Int]
+
+ class ExistentialType {
+ def foo(array: Array[T] forSome { type T <: AnyVal }) = 0
+ }
+}
diff --git a/test/scaladoc/scala/html/HtmlFactoryTest.scala b/test/scaladoc/scala/html/HtmlFactoryTest.scala
index ba9058724c..2c81be5d08 100644
--- a/test/scaladoc/scala/html/HtmlFactoryTest.scala
+++ b/test/scaladoc/scala/html/HtmlFactoryTest.scala
@@ -372,4 +372,35 @@ object Test extends Properties("HtmlFactory") {
case _ => false
}
}
+
+ {
+ val files = createTemplates("basic.scala")
+ println(files)
+
+ property("class") = files.get("com/example/p1/Clazz.html") match {
+ case Some(node: scala.xml.Node) => {
+ property("implicit convertion") =
+ node.toString contains "<span class=\"modifier\">implicit </span>"
+ true
+ }
+ case _ => false
+ }
+ property("package") = files.get("com/example/p1/package.html") != None
+
+ property("package object") = files("com/example/p1/package.html") match {
+ case node: scala.xml.Node =>
+ node.toString contains "com.example.p1.package#packageObjectMethod"
+ case _ => false
+ }
+
+ property("lower bound") = files("com/example/p1/LowerBound.html") match {
+ case node: scala.xml.Node => true
+ case _ => false
+ }
+
+ property("upper bound") = files("com/example/p1/UpperBound.html") match {
+ case node: scala.xml.Node => true
+ case _ => false
+ }
+ }
}