From 4afe128189134e95d255ab8828ed2da86198e2e9 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 30 Nov 2022 16:34:38 +0000 Subject: [PATCH] PT SOCKS tests: add a few more tests --- crates/tor-chanmgr/src/transport/proxied.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/tor-chanmgr/src/transport/proxied.rs b/crates/tor-chanmgr/src/transport/proxied.rs index 314355bb2..b296126b9 100644 --- a/crates/tor-chanmgr/src/transport/proxied.rs +++ b/crates/tor-chanmgr/src/transport/proxied.rs @@ -448,7 +448,6 @@ mod test { ); } - // TODO pt-client / FIXME(eta): make this test more complete #[cfg(feature = "pt-client")] #[test] fn split_settings() { @@ -499,5 +498,11 @@ mod test { // Huge requests with "0" simply can't be encoded. assert!(settings_to_protocol(V5, "\0".to_owned().repeat(511)).is_err()); + + // Huge requests without "0" can't be encoded as V5 + assert!(settings_to_protocol(V5, long_string[0..512].to_owned()).is_err()); + + // Requests with "0" can't be encoded as V4. + assert!(settings_to_protocol(V4, "\0".to_owned()).is_err()); } }