Skip to content

Commit

Permalink
Apply rustfmt to tests/openssh.rs
Browse files Browse the repository at this point in the history
Signed-off-by: Aalekh Patel <aalekh.gwpeck.7998@icloud.com>
  • Loading branch information
aalekhpatel07 committed Feb 11, 2023
1 parent 8ad0244 commit 04e93e6
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions tests/openssh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ async fn over_session_ok() {
for session in connects().await {
let mut command = std::process::Command::new("echo")
.arg("foo")
.over_ssh(&session).expect("No env vars or current working dir is set.");
.over_ssh(&session)
.expect("No env vars or current working dir is set.");

let child = command.output().await.unwrap();
assert_eq!(child.stdout, b"foo\n");
Expand All @@ -317,14 +318,14 @@ async fn over_session_ok() {
}
}


#[tokio::test]
#[cfg_attr(not(ci), ignore)]
async fn over_session_ok_require_escaping_arguments() {
for session in connects().await {
let mut command = std::process::Command::new("echo")
.arg("\"\'\' foo \'\'\"")
.over_ssh(&session).expect("No env vars or current working dir is set.");
.over_ssh(&session)
.expect("No env vars or current working dir is set.");

let child = command.output().await.unwrap();
assert_eq!(child.stdout, b"\"\'\' foo \'\'\"\n");
Expand Down Expand Up @@ -352,7 +353,10 @@ async fn over_session_err_because_env_var() {
.arg("MY_ENV_VAR")
.env("MY_ENV_VAR", "foo")
.over_ssh(&session);
assert!(matches!(command_with_env, Err(openssh::Error::CommandHasEnv)));
assert!(matches!(
command_with_env,
Err(openssh::Error::CommandHasEnv)
));
}
}

Expand All @@ -365,7 +369,10 @@ async fn over_session_err_because_cwd() {
.arg("foo")
.current_dir("/tmp")
.over_ssh(&session);
assert!(matches!(command_with_current_dir, Err(openssh::Error::CommandHasCwd)));
assert!(matches!(
command_with_current_dir,
Err(openssh::Error::CommandHasCwd)
));
}
}

Expand Down

0 comments on commit 04e93e6

Please sign in to comment.