From ec46a1fba7395714e65e0f6644b7ad429c985ec7 Mon Sep 17 00:00:00 2001 From: Antoine Gourlay Date: Tue, 15 Jul 2014 19:05:52 +0200 Subject: 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. --- test/scaladoc/run/t8557.check | 1 + test/scaladoc/run/t8557.scala | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 test/scaladoc/run/t8557.check create mode 100644 test/scaladoc/run/t8557.scala (limited to 'test/scaladoc/run') 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)") + } +} -- cgit v1.2.3