@@ -241,8 +241,10 @@ class UtilsSuite extends FunSuite with ResetSystemProperties {
241241 assertResolves(" spark.jar" , s " file: $cwd/spark.jar " )
242242 assertResolves(" spark.jar#app.jar" , s " file: $cwd/spark.jar%23app.jar " )
243243 assertResolves(" path to/file.txt" , s " file: $cwd/path%20to/file.txt " )
244- assertResolves(" C:\\ path\\ to\\ file.txt" , " file:/C:/path/to/file.txt" , testWindows = true )
245- assertResolves(" C:\\ path to\\ file.txt" , " file:/C:/path%20to/file.txt" , testWindows = true )
244+ if (SystemUtils .IS_OS_WINDOWS ) {
245+ assertResolves(" C:\\ path\\ to\\ file.txt" , " file:/C:/path/to/file.txt" , testWindows = true )
246+ assertResolves(" C:\\ path to\\ file.txt" , " file:/C:/path%20to/file.txt" , testWindows = true )
247+ }
246248 assertResolves(" file:/C:/path/to/file.txt" , " file:/C:/path/to/file.txt" , testWindows = true )
247249 assertResolves(" file:///C:/path/to/file.txt" , " file:/C:/path/to/file.txt" , testWindows = true )
248250 assertResolves(" file:/C:/file.txt#alias.txt" , " file:/C:/file.txt#alias.txt" , testWindows = true )
@@ -268,9 +270,11 @@ class UtilsSuite extends FunSuite with ResetSystemProperties {
268270 assertResolves(" hdfs:/jar1,file:/jar2,jar3" , s " hdfs:/jar1,file:/jar2,file: $cwd/jar3 " )
269271 assertResolves(" hdfs:/jar1,file:/jar2,jar3,jar4#jar5,path to/jar6" ,
270272 s " hdfs:/jar1,file:/jar2,file: $cwd/jar3,file: $cwd/jar4%23jar5,file: $cwd/path%20to/jar6 " )
271- assertResolves(""" hdfs:/jar1,file:/jar2,jar3,C:\pi.py#py.pi,C:\path to\jar4""" ,
272- s " hdfs:/jar1,file:/jar2,file: $cwd/jar3,file:/C:/pi.py%23py.pi,file:/C:/path%20to/jar4 " ,
273- testWindows = true )
273+ if (SystemUtils .IS_OS_WINDOWS ) {
274+ assertResolves( """ hdfs:/jar1,file:/jar2,jar3,C:\pi.py#py.pi,C:\path to\jar4""" ,
275+ s " hdfs:/jar1,file:/jar2,file: $cwd/jar3,file:/C:/pi.py%23py.pi,file:/C:/path%20to/jar4 " ,
276+ testWindows = true )
277+ }
274278 }
275279
276280 test(" nonLocalPaths" ) {
@@ -285,8 +289,8 @@ class UtilsSuite extends FunSuite with ResetSystemProperties {
285289 assert(Utils .nonLocalPaths(" local:/spark.jar,file:/smart.jar,family.py" ) === Array .empty)
286290 assert(Utils .nonLocalPaths(" hdfs:/spark.jar,s3:/smart.jar" ) ===
287291 Array (" hdfs:/spark.jar" , " s3:/smart.jar" ))
288- assert(Utils .nonLocalPaths(" hdfs:/path to/ spark.jar,path to/a.jar,s3:/path to /smart.jar" ) ===
289- Array (" hdfs:/path to/ spark.jar" , " s3:/path to /smart.jar" ))
292+ assert(Utils .nonLocalPaths(" hdfs:/spark.jar,path to/a.jar,s3:/smart.jar" ) ===
293+ Array (" hdfs:/spark.jar" , " s3:/smart.jar" ))
290294 assert(Utils .nonLocalPaths(" hdfs:/spark.jar,s3:/smart.jar,local.py,file:/hello/pi.py" ) ===
291295 Array (" hdfs:/spark.jar" , " s3:/smart.jar" ))
292296 assert(Utils .nonLocalPaths(" local.py,hdfs:/spark.jar,file:/hello/pi.py,s3:/smart.jar" ) ===
@@ -300,11 +304,6 @@ class UtilsSuite extends FunSuite with ResetSystemProperties {
300304 assert(Utils .nonLocalPaths(" local:///C:/some/path.jar" , testWindows = true ) === Array .empty)
301305 assert(Utils .nonLocalPaths(" hdfs:/a.jar,C:/my.jar,s3:/another.jar" , testWindows = true ) ===
302306 Array (" hdfs:/a.jar" , " s3:/another.jar" ))
303- assert(Utils .nonLocalPaths(
304- " hdfs:/path to/spark.jar,C:\\ path to\\ a.jar,s3:/path to/smart.jar"
305- , testWindows = true
306- ) ===
307- Array (" hdfs:/path to/spark.jar" , " s3:/path to/smart.jar" ))
308307 assert(Utils .nonLocalPaths(" D:/your.jar,hdfs:/a.jar,s3:/another.jar" , testWindows = true ) ===
309308 Array (" hdfs:/a.jar" , " s3:/another.jar" ))
310309 assert(Utils .nonLocalPaths(" hdfs:/a.jar,s3:/another.jar,e:/our.jar" , testWindows = true ) ===
0 commit comments