From a30445f634ba9c5463a39b2e29f64fe066e05308 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 12 Apr 2025 15:17:20 -0400 Subject: [PATCH] Refactor --- src/lib.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d7ba937..e09f795 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,21 +90,19 @@ mod tests { let dir_path = std::path::Path::new(&directory); Ok(dir_path.join(filename)) } + + pub fn test_file_directory() -> String { + String::from("tests/sample_tracks3") + } } #[test] fn test_get_title() { let filename = String::from("track01.flac"); - let dir = String::from("tests/sample_tracks3"); - // let dir_path = std::path::Path::new(&dir); - // let full_path = dir_path.join(filename); + let dir = util::test_file_directory(); - // println!("Path: {:?}", full_path); - - // assert!(full_path.exists(), "Path does not exists {:?}", full_path); match file_exists(&dir, &filename) { Ok(_) => { - // let filepath = full_path.display().to_string(); let filepath = get_full_path(&dir, &filename).unwrap(); match meta_next::get_meta(meta_type::Type::Title, &filepath) {