Skip to content

Commit 70a78c1

Browse files
committed
Impl new fn connects_with_name & use it in test_read_large_file_bug
Signed-off-by: Jiahao XU <[email protected]>
1 parent 92e673f commit 70a78c1

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

tests/openssh.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async fn session_builder_connect(mut builder: SessionBuilder, addr: &str) -> Vec
4646
sessions
4747
}
4848

49-
async fn connects() -> Vec<Session> {
49+
async fn connects_with_name() -> Vec<(Session, &'static str)> {
5050
let mut sessions = Vec::with_capacity(2);
5151

5252
let mut builder = SessionBuilder::default();
@@ -57,17 +57,25 @@ async fn connects() -> Vec<Session> {
5757

5858
#[cfg(feature = "process-mux")]
5959
{
60-
sessions.push(builder.connect(&addr()).await.unwrap());
60+
sessions.push((builder.connect(&addr()).await.unwrap(), "process-mux"));
6161
}
6262

6363
#[cfg(feature = "native-mux")]
6464
{
65-
sessions.push(builder.connect_mux(&addr()).await.unwrap());
65+
sessions.push((builder.connect_mux(&addr()).await.unwrap(), "native-mux"));
6666
}
6767

6868
sessions
6969
}
7070

71+
async fn connects() -> Vec<Session> {
72+
connects_with_name()
73+
.await
74+
.into_iter()
75+
.map(|(session, _name)| session)
76+
.collect()
77+
}
78+
7179
async fn connects_err(host: &str) -> Vec<Error> {
7280
session_builder_connects_err(host, SessionBuilder::default()).await
7381
}
@@ -940,7 +948,9 @@ async fn test_sftp_subsystem() {
940948
#[tokio::test]
941949
#[cfg_attr(not(ci), ignore)]
942950
async fn test_read_large_file_bug() {
943-
for session in connects().await {
951+
for (session, name) in connects_with_name().await {
952+
eprintln!("Testing {name} implementation");
953+
944954
let bs = 1024;
945955
let count = 20480;
946956

0 commit comments

Comments
 (0)