mirror of
https://github.com/rustdesk/rustdesk-server.git
synced 2026-11-27 00:04:24 +00:00
Require a timeout in the list tests' unlisted cases
An unlisted client passed if relay() or the connection ended with an error, not only if it stayed up until the timeout. Each case now names the one outcome it expects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq
This commit is contained in:
1 parent
511bba91f8
commit
9268f4340f
1 file changed
+6
-8
+6
-8
@@ -729,10 +729,9 @@ mod tests {
|
||||
)
|
||||
.await;
|
||||
BLOCKLIST.write().await.remove(entry);
|
||||
assert_eq!(
|
||||
matches!(result, Ok(Ok(()))),
|
||||
cut_off,
|
||||
"client {client}, blocklist entry {entry}"
|
||||
assert!(
|
||||
matches!((cut_off, &result), (true, Ok(Ok(()))) | (false, Err(_))),
|
||||
"client {client}, blocklist entry {entry}: {result:?}"
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -754,10 +753,9 @@ mod tests {
|
||||
handle_connection(stream, addr, &Limiter::new(1_000_000.), "", false).await;
|
||||
BLOCKLIST.write().await.remove(entry);
|
||||
let read = timeout(1_000, client.read(&mut [0; 1])).await;
|
||||
assert_eq!(
|
||||
matches!(read, Ok(Ok(0))),
|
||||
refused,
|
||||
"blocklist entry {entry}"
|
||||
assert!(
|
||||
matches!((refused, &read), (true, Ok(Ok(0))) | (false, Err(_))),
|
||||
"blocklist entry {entry}: {read:?}"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user