Fix shell extension tests on Windows
This commit is contained in:
parent
12fc31700e
commit
5db9d92642
|
@ -93,8 +93,13 @@ mod tests {
|
|||
let output = extension.calculate(¶ms);
|
||||
|
||||
assert!(output.is_some());
|
||||
|
||||
if cfg!(target_os = "windows") {
|
||||
assert_eq!(output.unwrap(), "hello world\r\n");
|
||||
}else{
|
||||
assert_eq!(output.unwrap(), "hello world\n");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_shell_trimmed() {
|
||||
|
@ -112,7 +117,12 @@ mod tests {
|
|||
#[test]
|
||||
fn test_shell_trimmed_2() {
|
||||
let mut params = Mapping::new();
|
||||
if cfg!(target_os = "windows") {
|
||||
params.insert(Value::from("cmd"), Value::from("echo hello world "));
|
||||
}else{
|
||||
params.insert(Value::from("cmd"), Value::from("echo \" hello world \""));
|
||||
}
|
||||
|
||||
params.insert(Value::from("trim"), Value::from(true));
|
||||
|
||||
let extension = ShellExtension::new();
|
||||
|
@ -132,8 +142,12 @@ mod tests {
|
|||
let output = extension.calculate(¶ms);
|
||||
|
||||
assert!(output.is_some());
|
||||
if cfg!(target_os = "windows") {
|
||||
assert_eq!(output.unwrap(), "hello world\r\n");
|
||||
}else{
|
||||
assert_eq!(output.unwrap(), "hello world\n");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
|
|
Loading…
Reference in New Issue
Block a user