From 71d2aba0428541d4109ec3c34b479fe69ebb2205 Mon Sep 17 00:00:00 2001 From: Kato Kazuyoshi Date: Tue, 29 Mar 2011 16:21:02 +0000 Subject: [scaladoc] Don't create broken link to private ... [scaladoc] Don't create broken link to private companion object. Closes #4374. Review by pedrofurla. --- test/scaladoc/resources/Trac4374.scala | 5 +++++ test/scaladoc/scala/html/HtmlFactoryTest.scala | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 test/scaladoc/resources/Trac4374.scala (limited to 'test') 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: companion""") && + 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: companion""") && + files.get("WithPrivate$.html") == None + } + case _ => false + } + } } -- cgit v1.2.3