From a17be60676ae8329672868872e33b65fa79cbe03 Mon Sep 17 00:00:00 2001 From: Stefan Zeiger Date: Tue, 22 Nov 2011 18:44:00 +0000 Subject: Make partest work with spaces in the path (from... Make partest work with spaces in the path (from batch script and ant task). - The 'partest' ant task gets a new 'compilerargs' element for scalac - options (like in scalacfork and javac). Fixed argument list handling - in partest task. Further improvements to argument list handling for - all ant tasks. Fixed argument list handling in DirectTest (used by - partest shell scripts) Fixed path handling in several test cases. Closes SI-622. Review by phaller. --- test/scaladoc/scala/IndexScriptTest.scala | 4 ++-- test/scaladoc/scala/IndexTest.scala | 6 +++--- test/scaladoc/scala/html/HtmlFactoryTest.scala | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'test/scaladoc') diff --git a/test/scaladoc/scala/IndexScriptTest.scala b/test/scaladoc/scala/IndexScriptTest.scala index 991491c376..e0372020fd 100644 --- a/test/scaladoc/scala/IndexScriptTest.scala +++ b/test/scaladoc/scala/IndexScriptTest.scala @@ -3,7 +3,7 @@ import org.scalacheck.Prop._ import scala.tools.nsc.doc import scala.tools.nsc.doc.html.page.IndexScript -import java.net.URLClassLoader +import java.net.{URLClassLoader, URLDecoder} object Test extends Properties("IndexScript") { @@ -11,7 +11,7 @@ object Test extends Properties("IndexScript") { val loader = Thread.currentThread.getContextClassLoader val paths = loader.asInstanceOf[URLClassLoader].getURLs val morepaths = loader.getParent.asInstanceOf[URLClassLoader].getURLs - (paths ++ morepaths).map(_.getPath).mkString(java.io.File.pathSeparator) + (paths ++ morepaths).map(u => URLDecoder.decode(u.getPath)).mkString(java.io.File.pathSeparator) } val docFactory = { diff --git a/test/scaladoc/scala/IndexTest.scala b/test/scaladoc/scala/IndexTest.scala index 2d731643da..c14fd98297 100644 --- a/test/scaladoc/scala/IndexTest.scala +++ b/test/scaladoc/scala/IndexTest.scala @@ -3,7 +3,7 @@ import org.scalacheck.Prop._ import scala.tools.nsc.doc import scala.tools.nsc.doc.html.page.Index -import java.net.URLClassLoader +import java.net.{URLClassLoader, URLDecoder} object Test extends Properties("Index") { @@ -12,8 +12,8 @@ object Test extends Properties("Index") { // 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. - val paths = Thread.currentThread.getContextClassLoader.asInstanceOf[URLClassLoader].getURLs.map(_.getPath) - val morepaths = Thread.currentThread.getContextClassLoader.getParent.asInstanceOf[URLClassLoader].getURLs.map(_.getPath) + val paths = Thread.currentThread.getContextClassLoader.asInstanceOf[URLClassLoader].getURLs.map(u => URLDecoder.decode(u.getPath)) + val morepaths = Thread.currentThread.getContextClassLoader.getParent.asInstanceOf[URLClassLoader].getURLs.map(u => URLDecoder.decode(u.getPath)) (paths ++ morepaths).mkString(java.io.File.pathSeparator) } diff --git a/test/scaladoc/scala/html/HtmlFactoryTest.scala b/test/scaladoc/scala/html/HtmlFactoryTest.scala index 9d40996799..916fe2e42f 100644 --- a/test/scaladoc/scala/html/HtmlFactoryTest.scala +++ b/test/scaladoc/scala/html/HtmlFactoryTest.scala @@ -1,7 +1,7 @@ import org.scalacheck._ import org.scalacheck.Prop._ -import java.net.URLClassLoader +import java.net.{URLClassLoader, URLDecoder} object XMLUtil { import scala.xml._ @@ -31,8 +31,8 @@ object Test extends Properties("HtmlFactory") { // 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. - val paths = Thread.currentThread.getContextClassLoader.asInstanceOf[URLClassLoader].getURLs.map(_.getPath) - val morepaths = Thread.currentThread.getContextClassLoader.getParent.asInstanceOf[URLClassLoader].getURLs.map(_.getPath) + val paths = Thread.currentThread.getContextClassLoader.asInstanceOf[URLClassLoader].getURLs.map(u => URLDecoder.decode(u.getPath)) + val morepaths = Thread.currentThread.getContextClassLoader.getParent.asInstanceOf[URLClassLoader].getURLs.map(u => URLDecoder.decode(u.getPath)) (paths ++ morepaths).mkString(java.io.File.pathSeparator) } -- cgit v1.2.3