File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -337,8 +337,7 @@ mod tests {
337
337
#[ cfg( not( target_os = "windows" ) ) ]
338
338
#[ test]
339
339
fn test_substitute_tilde ( ) {
340
- use std:: env;
341
- use std:: path:: MAIN_SEPARATOR ;
340
+ use std:: { env, path:: PathBuf } ;
342
341
let original_home = home_dir ( ) ;
343
342
let test_home_path = if cfg ! ( windows) {
344
343
"C:\\ Users\\ user"
@@ -350,9 +349,16 @@ mod tests {
350
349
test_home_path,
351
350
) ;
352
351
let input = "~/Code/datafusion/benchmarks/data/tpch_sf1/part/part-0.parquet" ;
353
- let expected = format ! (
354
- "{test_home_path}{MAIN_SEPARATOR}Code{MAIN_SEPARATOR}datafusion{MAIN_SEPARATOR}benchmarks{MAIN_SEPARATOR}data{MAIN_SEPARATOR}tpch_sf1{MAIN_SEPARATOR}part{MAIN_SEPARATOR}part-0.parquet"
355
- ) ;
352
+ let expected = PathBuf :: from ( test_home_path)
353
+ . join ( "Code" )
354
+ . join ( "datafusion" )
355
+ . join ( "benchmarks" )
356
+ . join ( "data" )
357
+ . join ( "tpch_sf1" )
358
+ . join ( "part" )
359
+ . join ( "part-0.parquet" )
360
+ . to_string_lossy ( )
361
+ . to_string ( ) ;
356
362
let actual = substitute_tilde ( input. to_string ( ) ) ;
357
363
assert_eq ! ( actual, expected) ;
358
364
match original_home {
You can’t perform that action at this time.
0 commit comments