From 844d8d73786ae86e15bae7f0598743fb2abe74be Mon Sep 17 00:00:00 2001 From: SARDONYX-sard <68905624+SARDONYX-sard@users.noreply.github.com> Date: Fri, 3 Nov 2023 07:44:00 +0900 Subject: [PATCH] fix(core): fix test path --- dar2oar_core/src/fs/mod.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dar2oar_core/src/fs/mod.rs b/dar2oar_core/src/fs/mod.rs index bd64a73..c21a55f 100644 --- a/dar2oar_core/src/fs/mod.rs +++ b/dar2oar_core/src/fs/mod.rs @@ -168,7 +168,7 @@ pub async fn remove_oar(search_dir: impl AsRef) -> Result<()> { if path.is_dir() { let path = path.to_str(); if let Some(path) = path { - if path.ends_with("OpenAnimationReplacer/") { + if path.ends_with("OpenAnimationReplacer") { trace!("Try to remove oar dir: {:?}", &path); fs::remove_dir_all(path).await?; removed_once = true; @@ -177,8 +177,13 @@ pub async fn remove_oar(search_dir: impl AsRef) -> Result<()> { } } - if removed_once { - return Err(ConvertError::NotFoundOarDir); + match removed_once { + true => Ok(()), + false => Err(ConvertError::NotFoundOarDir), } - Ok(()) +} + +#[tokio::test] +async fn remove_oar_dir() -> Result<()> { + remove_oar("../test/data/UNDERDOG Animations").await }