summaryrefslogtreecommitdiff
path: root/test/scaladoc
diff options
context:
space:
mode:
authorAntoine Gourlay <antoine@gourlay.fr>2014-07-15 19:05:52 +0200
committerAntoine Gourlay <antoine@gourlay.fr>2014-07-15 19:05:52 +0200
commitec46a1fba7395714e65e0f6644b7ad429c985ec7 (patch)
treec4076a68086d74fdb190641be35d767cf0bc20b9 /test/scaladoc
parentc763d8413b8e1ef5129378952b2327e8a7c2de7d (diff)
downloadscala-ec46a1fba7395714e65e0f6644b7ad429c985ec7.tar.gz
scala-ec46a1fba7395714e65e0f6644b7ad429c985ec7.tar.bz2
scala-ec46a1fba7395714e65e0f6644b7ad429c985ec7.zip
SI-8557 make scaladoc normalize paths of external jars.
Scaladoc compares (string representations of) the paths from -doc-external-doc and the paths form `sym.underlyingSource`. We now normalize on both ends before comparing them.
Diffstat (limited to 'test/scaladoc')
-rw-r--r--test/scaladoc/run/t8557.check1
-rw-r--r--test/scaladoc/run/t8557.scala32
2 files changed, 33 insertions, 0 deletions
diff --git a/test/scaladoc/run/t8557.check b/test/scaladoc/run/t8557.check
new file mode 100644
index 0000000000..619c56180b
--- /dev/null
+++ b/test/scaladoc/run/t8557.check
@@ -0,0 +1 @@
+Done.
diff --git a/test/scaladoc/run/t8557.scala b/test/scaladoc/run/t8557.scala
new file mode 100644
index 0000000000..451f004d7d
--- /dev/null
+++ b/test/scaladoc/run/t8557.scala
@@ -0,0 +1,32 @@
+import scala.tools.nsc.doc.base._
+import scala.tools.nsc.doc.model._
+import scala.tools.partest.ScaladocModelTest
+
+object Test extends ScaladocModelTest {
+
+ override def code = """
+ package scala.test.scaladoc.T8857
+
+ /**
+ * A link:
+ *
+ * [[scala.Option$ object Option]].
+ */
+ class A
+ """
+
+ // a non-canonical path to scala-library.jar should still work
+ // this is a bit fragile (depends on the current directory being the root of the repo ;
+ // ant & partest seem to do that properly)
+ def scaladocSettings = "-doc-external-doc build/pack/bin/../lib/scala-library.jar#http://www.scala-lang.org/api/current/"
+
+ def testModel(rootPackage: Package) = {
+ // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s))
+ import access._
+
+ val a = rootPackage._package("scala")._package("test")._package("scaladoc")._package("T8857")._class("A")
+
+ val links = countLinks(a.comment.get, _.link.isInstanceOf[LinkToExternal])
+ assert(links == 1, links + " == 1 (the links to external in class A)")
+ }
+}