summaryrefslogtreecommitdiff
path: root/test/scaladoc
diff options
context:
space:
mode:
authorStefan Zeiger <szeiger@novocode.com>2011-11-22 18:44:00 +0000
committerStefan Zeiger <szeiger@novocode.com>2011-11-22 18:44:00 +0000
commita17be60676ae8329672868872e33b65fa79cbe03 (patch)
tree40e6876b48a5138dfc77e105dc08a21bb62cdcdb /test/scaladoc
parentac031789039d421186567cf3b9a484957e6e5f8e (diff)
downloadscala-a17be60676ae8329672868872e33b65fa79cbe03.tar.gz
scala-a17be60676ae8329672868872e33b65fa79cbe03.tar.bz2
scala-a17be60676ae8329672868872e33b65fa79cbe03.zip
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.
Diffstat (limited to 'test/scaladoc')
-rw-r--r--test/scaladoc/scala/IndexScriptTest.scala4
-rw-r--r--test/scaladoc/scala/IndexTest.scala6
-rw-r--r--test/scaladoc/scala/html/HtmlFactoryTest.scala6
3 files changed, 8 insertions, 8 deletions
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)
}