From ad2beac49aa62c0e6907b04f5e1bac64d52f2080 Mon Sep 17 00:00:00 2001 From: DastInDark <2350416+hitenkoku@users.noreply.github.com> Date: Mon, 18 Jul 2022 00:14:46 +0900 Subject: [PATCH] add test #623 --- src/detections/utils.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/detections/utils.rs b/src/detections/utils.rs index 875658ec..a5b1179b 100644 --- a/src/detections/utils.rs +++ b/src/detections/utils.rs @@ -601,4 +601,14 @@ mod tests { "fake" ); } + + #[test] + /// 与えられた相対パスから不要な表記("./", "../")削除を確認するテスト + fn test_get_output_relative_path() { + let exist_path = Path::new("./test_files/rules/yaml/1.yml").to_path_buf(); + assert_eq!( + get_output_str_path(Path::new("."), &exist_path), + "test_files/rules/yaml/1.yml" + ); + } }