Skip to content

Commit

Permalink
fix test for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveL-MSFT committed Dec 16, 2024
1 parent e5f6018 commit 2222968
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dsc_lib/src/functions/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

Expand Down

0 comments on commit 2222968

Please sign in to comment.