@@ -18,7 +18,7 @@ class ClasspathTests:
1818 str.reverse.dropWhile(_ != '.' ).drop(1 ).reverse
1919
2020 extension(f : File ) def absPath =
21- f.getAbsolutePath.replace('\\ ' ,'/' )
21+ f.getAbsolutePath.replace('\\ ' , '/' )
2222
2323 // only interested in classpath test scripts
2424 def testFiles = scripts(" /scripting" ).filter { _.getName.matches(" classpath.*[.]sc" ) }
@@ -36,21 +36,21 @@ class ClasspathTests:
3636 */
3737 @ Test def scalacEchoTest =
3838 val relpath = testScript.toPath.relpath.norm
39- printf(" ===> scalacEchoTest for script [%s]\n " ,relpath)
40- printf(" bash is [%s]\n " ,bashExe)
39+ printf(" ===> scalacEchoTest for script [%s]\n " , relpath)
40+ printf(" bash is [%s]\n " , bashExe)
4141
4242 if packBinScalaExists then
4343 val echoTest = " SCALAC_ECHO_TEST=1"
4444 val bashCmdline = s " SCALA_OPTS= $echoTest dist/target/pack/bin/scala -classpath ' $wildcardEntry' $relpath"
4545
4646 // ask [dist/bin/scalac] to echo generated command line so we can verify some things
47- val cmd = Array (bashExe," -c" ,bashCmdline)
47+ val cmd = Array (bashExe, " -c" , bashCmdline)
4848
49- // cmd.foreach { printf("[%s]\n",_) }
49+ // cmd.foreach { printf("[%s]\n", _) }
5050
5151 val javaCommandLine = exec(cmd:_* ).mkString(" " ).split(" " ).filter { _.trim.nonEmpty }
52- printf(" \n ==================== isWin[%s], cygwin[%s], mingw[%s], msys[%s]\n " ,isWin,cygwin,mingw,msys)
53- javaCommandLine.foreach { printf(" java-command[%s]\n " ,_) }
52+ printf(" \n ==================== isWin[%s], cygwin[%s], mingw[%s], msys[%s]\n " , isWin, cygwin, mingw, msys)
53+ javaCommandLine.foreach { printf(" java-command[%s]\n " , _) }
5454
5555 val output = scala.collection.mutable.Queue (javaCommandLine:_* )
5656 output.dequeueWhile( _ != " dotty.tools.scripting.Main" )
@@ -63,54 +63,54 @@ class ClasspathTests:
6363
6464 // display command line starting with "dotty.tools.scripting.Main"
6565 output.foreach { line =>
66- printf(" %s\n " ,line)
66+ printf(" %s\n " , line)
6767 }
6868
6969 // expecting -classpath next
70- assert(consumeNext.replaceAll(" '" ," " ) == " -classpath" )
70+ assert(consumeNext.replaceAll(" '" , " " ) == " -classpath" )
7171
7272 // 2nd arg to scripting.Main is 'lib/*', with semicolon added if Windows jdk
7373
7474 // PR #10761: verify that [dist/bin/scala] -classpath processing adds $psep to wildcard if Windows
7575 val classpathValue = consumeNext
76- printf(" classpath value [%s]\n " ,classpathValue)
76+ printf(" classpath value [%s]\n " , classpathValue)
7777 assert( ! winshell || classpathValue.contains(psep) )
7878
7979 // expecting -script next
80- assert(consumeNext.replaceAll(" '" ," " ) == " -script" )
80+ assert(consumeNext.replaceAll(" '" , " " ) == " -script" )
8181
8282 // PR #10761: verify that Windows jdk did not expand single wildcard classpath to multiple file paths
8383 if javaCommandLine.last != relpath then
84- printf(" last: %s\n relp: %s\n " ,javaCommandLine.last,relpath)
85- assert(javaCommandLine.last == relpath,s " unexpected output passed to scripting.Main " )
84+ printf(" last: %s\n relp: %s\n " , javaCommandLine.last, relpath)
85+ assert(javaCommandLine.last == relpath, s " unexpected output passed to scripting.Main " )
8686
8787 /*
8888 * verify classpath reported by called script.
8989 */
9090 @ Test def hashbangClasspathVerifyTest =
9191 val relpath = testScript.toPath.relpath.norm
92- printf(" ===> hashbangClasspathVerifyTest for script [%s]\n " ,relpath)
93- printf(" bash is [%s]\n " ,bashExe)
92+ printf(" ===> hashbangClasspathVerifyTest for script [%s]\n " , relpath)
93+ printf(" bash is [%s]\n " , bashExe)
9494
9595 if false && packBinScalaExists then
9696 val bashCmdline = s " SCALA_OPTS= $relpath"
97- val cmd = Array (bashExe," -c" ,bashCmdline)
97+ val cmd = Array (bashExe, " -c" , bashCmdline)
9898
99- cmd.foreach { printf(" [%s]\n " ,_) }
99+ cmd.foreach { printf(" [%s]\n " , _) }
100100
101101 // test script reports the classpath it sees
102102 val scriptOutput = exec(cmd:_* )
103- val scriptCwd = findTaggedLine(" cwd" ,scriptOutput)
104- printf(" script ran in directory [%s]\n " ,scriptCwd)
105- val scriptCp = findTaggedLine(" classpath" ,scriptOutput)
103+ val scriptCwd = findTaggedLine(" cwd" , scriptOutput)
104+ printf(" script ran in directory [%s]\n " , scriptCwd)
105+ val scriptCp = findTaggedLine(" classpath" , scriptOutput)
106106
107107 val hashbangClasspathJars = scriptCp.split(psep).map { _.getName }.sorted.distinct
108108 val packlibJars = listJars(s " $scriptCwd/dist/target/pack/lib " ).sorted.distinct
109109
110110 // verify that the classpath set in the hashbang line is effective
111111 if hashbangClasspathJars.size != packlibJars.size then
112- printf(" %d test script jars in classpath\n " ,hashbangClasspathJars.size)
113- printf(" %d jar files in dist/target/pack/lib\n " ,packlibJars.size)
112+ printf(" %d test script jars in classpath\n " , hashbangClasspathJars.size)
113+ printf(" %d jar files in dist/target/pack/lib\n " , packlibJars.size)
114114
115115 assert(hashbangClasspathJars.size == packlibJars.size)
116116
@@ -127,7 +127,7 @@ def listJars(dir: String) =
127127 Nil
128128
129129import scala .jdk .CollectionConverters ._
130- lazy val env : Map [String ,String ] = System .getenv.asScala.toMap
130+ lazy val env : Map [String , String ] = System .getenv.asScala.toMap
131131
132132// script output expected as "<tag>: <value>"
133133def findTaggedLine (tag : String , lines : Seq [String ]): String =
@@ -161,7 +161,7 @@ def which(str:String) =
161161
162162def bashExe = which(" bash" )
163163def unameExe = which(" uname" )
164- def path = envOrElse(" PATH" ," " ).split(psep).toList
164+ def path = envOrElse(" PATH" , " " ).split(psep).toList
165165def psep = sys.props(" path.separator" )
166166
167167def cygwin = ostype == " cygwin"
@@ -174,10 +174,10 @@ def ostype = ostypeFull.toLowerCase.takeWhile{ cc => cc >= 'a' && cc <='z' || cc
174174
175175extension(p: Path )
176176 def relpath : Path = cwd.relativize(p)
177- def norm : String = p.toString.replace('\\ ' ,'/' )
177+ def norm : String = p.toString.replace('\\ ' , '/' )
178178
179179extension(path : String )
180- def getName : String = norm.replaceAll(" .*/" ," " )
180+ def getName : String = norm.replaceAll(" .*/" , " " )
181181
182182 // Normalize path separator, convert relative path to absolute
183183 def norm : String =
@@ -187,12 +187,12 @@ extension(path: String)
187187 case s => s
188188 }
189189
190- def parent : String = norm.replaceAll(" /[^/]*$" ," " )
190+ def parent : String = norm.replaceAll(" /[^/]*$" , " " )
191191
192192 // convert to absolute path relative to cwd.
193193 def absPath : String = norm match
194194 case str if str.isAbsolute => norm
195- case _ => Paths .get(userDir,norm).toString.norm
195+ case _ => Paths .get(userDir, norm).toString.norm
196196
197197 def isDir : Boolean = Files .isDirectory(Paths .get(path))
198198
0 commit comments