From e2f2015e062e5e254e92358ec13d237e8d22b9c5 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 14 Jan 2025 20:59:32 +0000 Subject: [PATCH] test: add regression test for native-tls crate --- Cargo.toml | 2 +- src/main.rs | 10 ++++++++++ examples/native-tls.rs => src/tls.rs | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) rename examples/native-tls.rs => src/tls.rs (96%) diff --git a/Cargo.toml b/Cargo.toml index 133dad7..7fa380b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,4 +4,4 @@ version = "0.1.0" edition = "2021" [dependencies] -native-tls = "0.2" +native-tls = { version = "0.2", features = ["vendored"] } diff --git a/src/main.rs b/src/main.rs index e7a11a9..f39eee9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,13 @@ +mod tls; fn main() { println!("Hello, world!"); + tls::main(); +} + +#[cfg(test)] +mod tests { + #[test] + fn passes() { + println!("passes okay"); + } } diff --git a/examples/native-tls.rs b/src/tls.rs similarity index 96% rename from examples/native-tls.rs rename to src/tls.rs index 32acc40..f4cb49c 100644 --- a/examples/native-tls.rs +++ b/src/tls.rs @@ -2,7 +2,7 @@ use native_tls::TlsConnector; use std::io::{Read, Write}; use std::net::TcpStream; -fn main() { +pub fn main() { let connector = TlsConnector::new().unwrap(); let stream = TcpStream::connect("google.com:443").unwrap();