tsk-44 #47

Merged
phoenix merged 15 commits from tsk-44 into main 2025-10-21 16:20:51 +00:00
Showing only changes of commit ab15fbcd1f - Show all commits

View File

@@ -18,3 +18,22 @@ pub fn file_type(filepath: &str) -> Result<String, std::io::Error> {
} }
} }
} }
#[cfg(test)]
mod tests {
#[test]
fn test_coverart_file_type() {
let directory = String::from(crate::test_util::util::TESTFILEDIRECTORY);
let filename = String::from("Sample Tracks 3.png");
let filepath = format!("{directory}/{filename}");
match super::file_type(&filepath) {
Ok(filetype) => {
assert_eq!(filetype, "png", "The file type of the CoverArt should have been png");
}
Err(err) => {
assert!(false, "Error: {err:?}");
}
}
}
}