Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Aug 28, 2024
1 parent 1f29e77 commit c825fe4
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions src/socks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,35 +99,3 @@ impl fmt::Display for Socks5Config {
)
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_socks5h_url() {
let config = Socks5Config {
host: "127.0.0.1".to_string(),
port: 9050,
user_password: None,
};
assert_eq!(config.to_url(), "socks5h://127.0.0.1:9050");

let config = Socks5Config {
host: "example.org".to_string(),
port: 1080,
user_password: Some(("root".to_string(), "toor".to_string())),
};
assert_eq!(config.to_url(), "socks5h://root:[email protected]:1080");

let config = Socks5Config {
host: "example.org".to_string(),
port: 1080,
user_password: Some(("root".to_string(), "foo/?\\@".to_string())),
};
assert_eq!(
config.to_url(),
"socks5h://root:foo%2F%3F%5C%[email protected]:1080"
);
}
}

0 comments on commit c825fe4

Please sign in to comment.