Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveL-MSFT committed Dec 17, 2024
1 parent 8d63099 commit 97dd6a9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dsc_lib/src/functions/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ mod tests {
fn start_with_drive_letter() {
let mut parser = Statement::new().unwrap();
let result = parser.parse_and_execute("[path('C:\\','test')]", &Context::new()).unwrap();

#[cfg(target_os = "windows")]
assert_eq!(result, format!("C:{SEPARATOR}test"));

#[cfg(not(target_os = "windows"))]
assert_eq!(result, format!("C:\\{SEPARATOR}test"));
}

#[test]
Expand All @@ -68,7 +73,7 @@ mod tests {

// non-Windows, the colon is a valid character in a path
#[cfg(not(target_os = "windows"))]
assert_eq!(result, format!("a{SEPARATOR}C:{SEPARATOR}test"));
assert_eq!(result, format!("a{SEPARATOR}C:\\{SEPARATOR}test"));
}

#[test]
Expand All @@ -82,7 +87,7 @@ mod tests {

// non-Windows, the colon is a valid character in a path
#[cfg(not(target_os = "windows"))]
assert_eq!(result, format!("C:{SEPARATOR}D:{SEPARATOR}test"));
assert_eq!(result, format!("C:\\{SEPARATOR}D:\\{SEPARATOR}test"));
}

#[test]
Expand Down

0 comments on commit 97dd6a9

Please sign in to comment.