We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe5f098 commit 0cd259bCopy full SHA for 0cd259b
dsc_lib/src/functions/target_path.rs
@@ -38,13 +38,18 @@ impl Function for TargetPath {
38
mod tests {
39
use crate::configure::context::Context;
40
use crate::parser::Statement;
41
- use std::path::PathBuf;
+ use std::{env, path::PathBuf};
42
43
#[test]
44
fn init() {
45
let mut parser = Statement::new().unwrap();
46
let result = parser.parse_and_execute("[targetPath()]", &Context::new()).unwrap();
47
- assert_eq!(result, "");
+ // on windows, the default is SYSTEMDRIVE env var
48
+ #[cfg(target_os = "windows")]
49
+ assert_eq!(result, env::var("SYSTEMDRIVE").unwrap());
50
+ // on linux/macOS, the default is /
51
+ #[cfg(not(target_os = "windows"))]
52
+ assert_eq!(result, "/");
53
}
54
55
0 commit comments