From 2222968b6e003721642bc2f0826856847ffd11f6 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Sun, 15 Dec 2024 18:27:53 -0800 Subject: [PATCH] fix test for Windows --- dsc_lib/src/functions/path.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dsc_lib/src/functions/path.rs b/dsc_lib/src/functions/path.rs index cea497db..4240ff5a 100644 --- a/dsc_lib/src/functions/path.rs +++ b/dsc_lib/src/functions/path.rs @@ -68,6 +68,11 @@ mod tests { let mut parser = Statement::new().unwrap(); let separator = std::path::MAIN_SEPARATOR; let result = parser.parse_and_execute("[path('a','C:','test')]", &Context::new()).unwrap(); + + // if any part of the path is absolute, it replaces it instead of appending + #[cfg(target_os = "windows")] + assert_eq!(result, format!("C:{separator}test")); + #[cfg(not(target_os = "windows"))] assert_eq!(result, format!("a{separator}C:{separator}test")); }