summaryrefslogtreecommitdiff
path: root/crates/utils/tcp_connection/tcp_connection_test
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2025-10-30 09:26:33 +0800
committerGitHub <noreply@github.com>2025-10-30 09:26:33 +0800
commit67ddf17efe909128732473b28a100fe2f58fdf46 (patch)
tree97382930372225a0cd2735b957da4770170d477c /crates/utils/tcp_connection/tcp_connection_test
parent4f35da85641549c3e08c4e1b73fccfc7ec9779a2 (diff)
parentd879d8864864d51f48201ea3fcf43baad2f969f6 (diff)
Merge pull request #31 from JustEnoughVCS/jvcs_dev_actions
Jvcs dev actions
Diffstat (limited to 'crates/utils/tcp_connection/tcp_connection_test')
-rw-r--r--crates/utils/tcp_connection/tcp_connection_test/src/test_challenge.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/utils/tcp_connection/tcp_connection_test/src/test_challenge.rs b/crates/utils/tcp_connection/tcp_connection_test/src/test_challenge.rs
index 2fc1a87..9327b3e 100644
--- a/crates/utils/tcp_connection/tcp_connection_test/src/test_challenge.rs
+++ b/crates/utils/tcp_connection/tcp_connection_test/src/test_challenge.rs
@@ -69,8 +69,9 @@ impl ServerHandle<ExampleChallengeClientHandle> for ExampleChallengeServerHandle
async fn process(mut instance: ConnectionInstance) {
// Challenge with correct key
let key_dir = current_dir().unwrap().join("res").join("key");
- let result = instance.challenge(key_dir).await.unwrap();
+ let (result, key_id) = instance.challenge(key_dir).await.unwrap();
assert!(result);
+ assert_eq!(key_id, "test_key");
// Send response
instance
@@ -80,8 +81,9 @@ impl ServerHandle<ExampleChallengeClientHandle> for ExampleChallengeServerHandle
// Challenge again
let key_dir = current_dir().unwrap().join("res").join("key");
- let result = instance.challenge(key_dir).await.unwrap();
+ let (result, key_id) = instance.challenge(key_dir).await.unwrap();
assert!(!result);
+ assert_eq!(key_id, "test_key");
// Send response
instance
@@ -91,8 +93,9 @@ impl ServerHandle<ExampleChallengeClientHandle> for ExampleChallengeServerHandle
// Challenge again
let key_dir = current_dir().unwrap().join("res").join("key");
- let result = instance.challenge(key_dir).await.unwrap();
+ let (result, key_id) = instance.challenge(key_dir).await.unwrap();
assert!(!result);
+ assert_eq!(key_id, "test_key__");
// Send response
instance