From ad8e496862929df8d3a6a70aea294be79891d521 Mon Sep 17 00:00:00 2001 From: peefy Date: Sat, 14 Sep 2024 19:47:57 +0800 Subject: [PATCH] fix: override file windows test CI Signed-off-by: peefy --- kclvm/query/src/tests.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kclvm/query/src/tests.rs b/kclvm/query/src/tests.rs index 90876f650..401cdde2c 100644 --- a/kclvm/query/src/tests.rs +++ b/kclvm/query/src/tests.rs @@ -13,8 +13,14 @@ const CARGO_FILE_PATH: &str = env!("CARGO_MANIFEST_DIR"); fn get_test_dir(sub: String) -> PathBuf { let mut cargo_file_path = PathBuf::from(CARGO_FILE_PATH); - cargo_file_path.push("src/test_data"); - cargo_file_path.push(sub); + cargo_file_path.push("src"); + cargo_file_path.push("test_data"); + // Split unix and windows path + for part in sub.split("/") { + for p in part.split("\\") { + cargo_file_path.push(p); + } + } cargo_file_path }