diff options
author | Seth Tisue <seth@tisue.net> | 2017-01-23 14:35:47 -0800 |
---|---|---|
committer | Seth Tisue <seth@tisue.net> | 2017-01-27 09:29:53 -0800 |
commit | 4386b948a0b597cc78e4f3b22b51e0588a5b6d60 (patch) | |
tree | eca8cea41d110d8b14d27a83ae06a90e966f9621 /test/scaladoc/scalacheck/IndexScriptTest.scala | |
parent | 27c10db549e6f43571663d0162b58fc04fbb34bf (diff) | |
download | scala-4386b948a0b597cc78e4f3b22b51e0588a5b6d60.tar.gz scala-4386b948a0b597cc78e4f3b22b51e0588a5b6d60.tar.bz2 scala-4386b948a0b597cc78e4f3b22b51e0588a5b6d60.zip |
run ScalaCheck tests directly, not through partest
ScalaCheck ever being under partest in the first place is ancient
history, from back in the Ant build days (shudder)
ScalaCheck support was removed from partest 1.1.0, which we already
upgraded to in a recent commit
also upgrades ScalaCheck from 1.11.6 to 1.13.4, since we might
as well. no source changes were necessary.
Diffstat (limited to 'test/scaladoc/scalacheck/IndexScriptTest.scala')
-rw-r--r-- | test/scaladoc/scalacheck/IndexScriptTest.scala | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/test/scaladoc/scalacheck/IndexScriptTest.scala b/test/scaladoc/scalacheck/IndexScriptTest.scala deleted file mode 100644 index 61f462186d..0000000000 --- a/test/scaladoc/scalacheck/IndexScriptTest.scala +++ /dev/null @@ -1,55 +0,0 @@ -import org.scalacheck._ -import org.scalacheck.Prop._ - -import scala.tools.nsc.doc -import scala.tools.nsc.doc.html.page.IndexScript -import java.net.{URLClassLoader, URLDecoder} - -object Test extends Properties("IndexScript") { - - def getClasspath = { - // these things can be tricky - // this test previously relied on the assumption that the current thread's classloader is an url classloader and contains all the classpaths - // does partest actually guarantee this? to quote Leonard Nimoy: The answer, of course, is no. - // this test _will_ fail again some time in the future. - // Footnote: java.lang.ClassCastException: org.apache.tools.ant.loader.AntClassLoader5 cannot be cast to java.net.URLClassLoader - val loader = Thread.currentThread.getContextClassLoader.asInstanceOf[URLClassLoader] - val paths = loader.getURLs.map(u => URLDecoder.decode(u.getPath)) - paths mkString java.io.File.pathSeparator - } - - val docFactory = { - val settings = new doc.Settings({Console.err.println(_)}) - settings.scaladocQuietRun = true - settings.nowarn.value = true - settings.classpath.value = getClasspath - val reporter = new scala.tools.nsc.reporters.ConsoleReporter(settings) - new doc.DocFactory(reporter, settings) - } - - val indexModelFactory = doc.model.IndexModelFactory - - def createIndexScript(path: String) = - docFactory.makeUniverse(Left(List(path))) match { - case Some(universe) => - Some(new IndexScript(universe)) - case _ => - None - } - - property("allPackages") = { - createIndexScript("src/scaladoc/scala/tools/nsc/doc/html/page/IndexScript.scala") match { - case Some(index) => - index.allPackages.map(_.toString) == List( - "scala", - "scala.tools", - "scala.tools.nsc", - "scala.tools.nsc.doc", - "scala.tools.nsc.doc.html", - "scala.tools.nsc.doc.html.page" - ) - case None => - false - } - } -} |