Skip to content

Commit

Permalink
Add test for wss:// explicit failure when TLS support is not compiled in
Browse files Browse the repository at this point in the history
  • Loading branch information
maugier committed Aug 12, 2024
1 parent 914c521 commit 1e5a9ae
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/wss_fails_when_no_tls.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#![cfg(not(any(feature = "native-tls", feature = "__rustls-tls")))]

use tungstenite::{connect, error::UrlError, Error};

#[test]
fn wss_url_fails_when_no_tls_support() {
let ws = connect("wss://127.0.0.1/ws");
eprintln!("{:?}", ws);
assert!(matches!(ws, Err(Error::Url(UrlError::TlsFeatureNotEnabled))))
}

0 comments on commit 1e5a9ae

Please sign in to comment.