summaryrefslogtreecommitdiff
path: root/test/scaladoc
diff options
context:
space:
mode:
authorKato Kazuyoshi <kato.kazuyoshi@gmail.com>2011-10-04 12:24:45 +0000
committerKato Kazuyoshi <kato.kazuyoshi@gmail.com>2011-10-04 12:24:45 +0000
commit5d283f3f68a6b855afbfc01df784cd972f5b4ced (patch)
tree4a8027463b97d9a766770faf70cdafa6b937a960 /test/scaladoc
parent7ab032f25a90fb5f2788726695a5011cb47406e0 (diff)
downloadscala-5d283f3f68a6b855afbfc01df784cd972f5b4ced.tar.gz
scala-5d283f3f68a6b855afbfc01df784cd972f5b4ced.tar.bz2
scala-5d283f3f68a6b855afbfc01df784cd972f5b4ced.zip
Add some basic tests for Scaladoc.
Diffstat (limited to 'test/scaladoc')
-rw-r--r--test/scaladoc/resources/basic.scala20
-rw-r--r--test/scaladoc/scala/html/HtmlFactoryTest.scala31
2 files changed, 51 insertions, 0 deletions
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
+ }
+ }
}