summaryrefslogtreecommitdiff
path: root/test/scaladoc
diff options
context:
space:
mode:
authorVlad Ureche <vlad.ureche@epfl.ch>2011-11-22 19:09:28 +0000
committerVlad Ureche <vlad.ureche@epfl.ch>2011-11-22 19:09:28 +0000
commit03112a3a3de9654d5d23310baeae667d49fe1017 (patch)
treecec72fdd4e5f43723495d1baa8073199b9940489 /test/scaladoc
parenta17be60676ae8329672868872e33b65fa79cbe03 (diff)
downloadscala-03112a3a3de9654d5d23310baeae667d49fe1017.tar.gz
scala-03112a3a3de9654d5d23310baeae667d49fe1017.tar.bz2
scala-03112a3a3de9654d5d23310baeae667d49fe1017.zip
Changed the way use cases are handled in scaladoc.
If use cases are present, the original member disappears from the list. References SI-5054, but needs more work on the html part. If use cases are present along with links, scaladoc doesn't crash anymore. Closes SI-4898. Review by kzys.
Diffstat (limited to 'test/scaladoc')
-rw-r--r--test/scaladoc/resources/SI_4898.scala9
-rw-r--r--test/scaladoc/resources/SI_5054.scala10
-rw-r--r--test/scaladoc/scala/html/HtmlFactoryTest.scala15
3 files changed, 34 insertions, 0 deletions
diff --git a/test/scaladoc/resources/SI_4898.scala b/test/scaladoc/resources/SI_4898.scala
new file mode 100644
index 0000000000..40461d15b5
--- /dev/null
+++ b/test/scaladoc/resources/SI_4898.scala
@@ -0,0 +1,9 @@
+class SI_4898 {
+
+ /**
+ * A link to [[__root__
+ *
+ * @usecase def test(): Int
+ */
+ def test(implicit param: Int): Int = param
+} \ No newline at end of file
diff --git a/test/scaladoc/resources/SI_5054.scala b/test/scaladoc/resources/SI_5054.scala
new file mode 100644
index 0000000000..17167303e4
--- /dev/null
+++ b/test/scaladoc/resources/SI_5054.scala
@@ -0,0 +1,10 @@
+class SI_5054 {
+
+ /**
+ * A simple comment
+ *
+ * @param lost a lost parameter
+ * @usecase def test(): Int
+ */
+ def test(implicit lost: Int): Int = lost
+} \ No newline at end of file
diff --git a/test/scaladoc/scala/html/HtmlFactoryTest.scala b/test/scaladoc/scala/html/HtmlFactoryTest.scala
index 916fe2e42f..adad3b6053 100644
--- a/test/scaladoc/scala/html/HtmlFactoryTest.scala
+++ b/test/scaladoc/scala/html/HtmlFactoryTest.scala
@@ -373,6 +373,21 @@ object Test extends Properties("HtmlFactory") {
}
}
+ property("Use cases and links should not crash scaladoc") = {
+ createTemplate("SI_4898.scala")
+ true
+ }
+
+ property("Use cases should override their original members - valid until signature is added to html") = {
+ createTemplate("SI_5054.scala") match {
+ case node: scala.xml.Node =>
+ node.toString.contains("A simple comment") &&
+ ! node.toString.contains("a lost parameter")
+ case _ => false
+ }
+ }
+
+
{
val files = createTemplates("basic.scala")
println(files)