Skip to content

Commit 97dd6a9

Browse files
committed
fix unit tests
1 parent 8d63099 commit 97dd6a9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

dsc_lib/src/functions/path.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ mod tests {
5454
fn start_with_drive_letter() {
5555
let mut parser = Statement::new().unwrap();
5656
let result = parser.parse_and_execute("[path('C:\\','test')]", &Context::new()).unwrap();
57+
58+
#[cfg(target_os = "windows")]
5759
assert_eq!(result, format!("C:{SEPARATOR}test"));
60+
61+
#[cfg(not(target_os = "windows"))]
62+
assert_eq!(result, format!("C:\\{SEPARATOR}test"));
5863
}
5964

6065
#[test]
@@ -68,7 +73,7 @@ mod tests {
6873

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

7479
#[test]
@@ -82,7 +87,7 @@ mod tests {
8287

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

8893
#[test]

0 commit comments

Comments
 (0)