summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKato Kazuyoshi <kato.kazuyoshi@gmail.com>2011-03-29 16:21:02 +0000
committerKato Kazuyoshi <kato.kazuyoshi@gmail.com>2011-03-29 16:21:02 +0000
commit71d2aba0428541d4109ec3c34b479fe69ebb2205 (patch)
treeebe97be368793de2a0370cd06eb9993c4808f617 /test
parent9e2b204400c4b2644004b654478cdae4b3dd6ed6 (diff)
downloadscala-71d2aba0428541d4109ec3c34b479fe69ebb2205.tar.gz
scala-71d2aba0428541d4109ec3c34b479fe69ebb2205.tar.bz2
scala-71d2aba0428541d4109ec3c34b479fe69ebb2205.zip
[scaladoc] Don't create broken link to private ...
[scaladoc] Don't create broken link to private companion object. Closes #4374. Review by pedrofurla.
Diffstat (limited to 'test')
-rw-r--r--test/scaladoc/resources/Trac4374.scala5
-rw-r--r--test/scaladoc/scala/html/HtmlFactoryTest.scala24
2 files changed, 29 insertions, 0 deletions
diff --git a/test/scaladoc/resources/Trac4374.scala b/test/scaladoc/resources/Trac4374.scala
new file mode 100644
index 0000000000..4dd8ba2ae8
--- /dev/null
+++ b/test/scaladoc/resources/Trac4374.scala
@@ -0,0 +1,5 @@
+class WithPublic
+object WithPublic
+
+class WithPrivate
+private object WithPrivate
diff --git a/test/scaladoc/scala/html/HtmlFactoryTest.scala b/test/scaladoc/scala/html/HtmlFactoryTest.scala
index 853a7c0fd2..ab76cbc7fc 100644
--- a/test/scaladoc/scala/html/HtmlFactoryTest.scala
+++ b/test/scaladoc/scala/html/HtmlFactoryTest.scala
@@ -130,4 +130,28 @@ object Test extends Properties("HtmlFactory") {
case _ => false
}
}
+
+ property("Trac #4374 - public") = {
+ val files = createTemplates("Trac4374.scala")
+ files("WithPublic.html") match {
+ case node: scala.xml.Node => {
+ val s = node.toString
+ s.contains("""go to: <a href="WithPublic$.html">companion</a>""") &&
+ files.get("WithPublic$.html") != None
+ }
+ case _ => false
+ }
+ }
+
+ property("Trac #4374 - private") = {
+ val files = createTemplates("Trac4374.scala")
+ files("WithPrivate.html") match {
+ case node: scala.xml.Node => {
+ val s = node.toString
+ ! s.contains("""go to: <a href="WithPrivate$.html">companion</a>""") &&
+ files.get("WithPrivate$.html") == None
+ }
+ case _ => false
+ }
+ }
}