Skip to content

Commit 0451454

Browse files
committed
refactor: replace long format! string
1 parent a389943 commit 0451454

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

datafusion-cli/src/catalog.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,7 @@ mod tests {
337337
#[cfg(not(target_os = "windows"))]
338338
#[test]
339339
fn test_substitute_tilde() {
340-
use std::env;
341-
use std::path::MAIN_SEPARATOR;
340+
use std::{env, path::PathBuf};
342341
let original_home = home_dir();
343342
let test_home_path = if cfg!(windows) {
344343
"C:\\Users\\user"
@@ -350,9 +349,16 @@ mod tests {
350349
test_home_path,
351350
);
352351
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();
356362
let actual = substitute_tilde(input.to_string());
357363
assert_eq!(actual, expected);
358364
match original_home {

0 commit comments

Comments
 (0)