Skip to content

Commit

Permalink
test: add test for #42
Browse files Browse the repository at this point in the history
  • Loading branch information
Miyoshi-Ryota committed Oct 20, 2023
1 parent b19626f commit 46941ec
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,4 +701,16 @@ ASYNC_SSH2_TEST_SERVER_PUB
.await;
assert!(client.is_ok());
}

#[tokio::test]
async fn client_can_be_cloned() {
let client = establish_test_host_connection().await;
let client2 = client.clone();

let result1 = client.execute("echo test clone").await.unwrap();
let result2 = client2.execute("echo test clone2").await.unwrap();

assert_eq!(result1.stdout, "test clone\n");
assert_eq!(result2.stdout, "test clone2\n");
}
}

0 comments on commit 46941ec

Please sign in to comment.