Remove song (#64)

Reviewed-on: #64
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
phoenix
2025-10-11 19:46:00 +00:00
committed by phoenix
parent 0637a9432e
commit c263cedf28
4 changed files with 27 additions and 8 deletions
+7 -3
View File
@@ -120,7 +120,7 @@ mod song_tests {
}
#[test]
fn test_save_song_to_filesystem() {
fn test_save_song_to_filesystem_and_remove() {
let mut song = song::Song::default();
song.directory = utils::get_tests_directory();
song.filename = String::from("track02.flac");
@@ -132,7 +132,12 @@ mod song_tests {
};
match song::io::copy_song(&song, &mut copied_song) {
Ok(_) => {}
Ok(_) => match copied_song.remove_from_filesystem() {
Ok(_) => {}
Err(err) => {
assert!(false, "Error: {err:?}")
}
},
Err(err) => {
assert!(false, "Error: {err:?}")
}
@@ -142,7 +147,6 @@ mod song_tests {
#[cfg(test)]
mod album_tests {
use crate::utils;
use icarus_models::album;