Merge branch 'dev-1.x-core' of github.com:federico-terzi/espanso into dev-1.x-core

This commit is contained in:
Federico Terzi 2021-04-21 21:35:39 +02:00
commit 1e65d2ead6
2 changed files with 15 additions and 6 deletions

View File

@ -29,6 +29,7 @@ fn cc_config() {
println!("cargo:rustc-link-lib=static=espansoclipboard"); println!("cargo:rustc-link-lib=static=espansoclipboard");
println!("cargo:rustc-link-lib=dylib=user32"); println!("cargo:rustc-link-lib=dylib=user32");
println!("cargo:rustc-link-lib=dylib=gdi32");
#[cfg(target_env = "gnu")] #[cfg(target_env = "gnu")]
println!("cargo:rustc-link-lib=dylib=stdc++"); println!("cargo:rustc-link-lib=dylib=stdc++");
} }

View File

@ -343,10 +343,13 @@ mod tests {
) )
} else { } else {
Params::from_iter( Params::from_iter(
vec![( vec![
"cmd".to_string(), (
Value::String("echo %ESPANSO_VAR1%".to_string()), "cmd".to_string(),
)] Value::String("echo %ESPANSO_VAR1%".to_string()),
),
("shell".to_string(), Value::String("cmd".to_string())),
]
.into_iter(), .into_iter(),
) )
}; };
@ -365,8 +368,13 @@ mod tests {
fn invalid_command() { fn invalid_command() {
let extension = ShellExtension::new(&PathBuf::new()); let extension = ShellExtension::new(&PathBuf::new());
let param = let param = Params::from_iter(
Params::from_iter(vec![("cmd".to_string(), Value::String("nonexistentcommand".to_string()))].into_iter()); vec![(
"cmd".to_string(),
Value::String("nonexistentcommand".to_string()),
)]
.into_iter(),
);
assert!(matches!( assert!(matches!(
extension.calculate(&Default::default(), &Default::default(), &param), extension.calculate(&Default::default(), &Default::default(), &param),
ExtensionResult::Error(_) ExtensionResult::Error(_)