@@ -241,8 +241,10 @@ class UtilsSuite extends FunSuite with ResetSystemProperties {
241
241
assertResolves(" spark.jar" , s " file: $cwd/spark.jar " )
242
242
assertResolves(" spark.jar#app.jar" , s " file: $cwd/spark.jar%23app.jar " )
243
243
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
+ }
246
248
assertResolves(" file:/C:/path/to/file.txt" , " file:/C:/path/to/file.txt" , testWindows = true )
247
249
assertResolves(" file:///C:/path/to/file.txt" , " file:/C:/path/to/file.txt" , testWindows = true )
248
250
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 {
268
270
assertResolves(" hdfs:/jar1,file:/jar2,jar3" , s " hdfs:/jar1,file:/jar2,file: $cwd/jar3 " )
269
271
assertResolves(" hdfs:/jar1,file:/jar2,jar3,jar4#jar5,path to/jar6" ,
270
272
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
+ }
274
278
}
275
279
276
280
test(" nonLocalPaths" ) {
@@ -285,8 +289,8 @@ class UtilsSuite extends FunSuite with ResetSystemProperties {
285
289
assert(Utils .nonLocalPaths(" local:/spark.jar,file:/smart.jar,family.py" ) === Array .empty)
286
290
assert(Utils .nonLocalPaths(" hdfs:/spark.jar,s3:/smart.jar" ) ===
287
291
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" ))
290
294
assert(Utils .nonLocalPaths(" hdfs:/spark.jar,s3:/smart.jar,local.py,file:/hello/pi.py" ) ===
291
295
Array (" hdfs:/spark.jar" , " s3:/smart.jar" ))
292
296
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 {
300
304
assert(Utils .nonLocalPaths(" local:///C:/some/path.jar" , testWindows = true ) === Array .empty)
301
305
assert(Utils .nonLocalPaths(" hdfs:/a.jar,C:/my.jar,s3:/another.jar" , testWindows = true ) ===
302
306
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" ))
308
307
assert(Utils .nonLocalPaths(" D:/your.jar,hdfs:/a.jar,s3:/another.jar" , testWindows = true ) ===
309
308
Array (" hdfs:/a.jar" , " s3:/another.jar" ))
310
309
assert(Utils .nonLocalPaths(" hdfs:/a.jar,s3:/another.jar,e:/our.jar" , testWindows = true ) ===
0 commit comments