Skip to content

Commit 2222968

Browse files
committed
fix test for Windows
1 parent e5f6018 commit 2222968

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dsc_lib/src/functions/path.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ mod tests {
6868
let mut parser = Statement::new().unwrap();
6969
let separator = std::path::MAIN_SEPARATOR;
7070
let result = parser.parse_and_execute("[path('a','C:','test')]", &Context::new()).unwrap();
71+
72+
// if any part of the path is absolute, it replaces it instead of appending
73+
#[cfg(target_os = "windows")]
74+
assert_eq!(result, format!("C:{separator}test"));
75+
#[cfg(not(target_os = "windows"))]
7176
assert_eq!(result, format!("a{separator}C:{separator}test"));
7277
}
7378

0 commit comments

Comments
 (0)