Properly activate features for examples and tests

pull/347/head
Daniel Abramov 2 years ago
parent 87e9f576af
commit 7e4a15446d
  1. 24
      Cargo.toml
  2. 3
      tests/connection_reset.rs
  3. 3
      tests/no_send_after_close.rs
  4. 3
      tests/receive_after_init_close.rs

@ -71,3 +71,27 @@ rand = "0.8.4"
[[bench]]
name = "buffer"
harness = false
[[example]]
name = "client"
required-features = ["handshake"]
[[example]]
name = "server"
required-features = ["handshake"]
[[example]]
name = "autobahn-client"
required-features = ["handshake"]
[[example]]
name = "autobahn-server"
required-features = ["handshake"]
[[example]]
name = "callback-error"
required-features = ["handshake"]
[[example]]
name = "srv_accept_unmasked_frames"
required-features = ["handshake"]

@ -1,6 +1,7 @@
//! Verifies that the server returns a `ConnectionClosed` error when the connection
//! is closed from the server's point of view and drop the underlying tcp socket.
#![cfg(any(feature = "native-tls", feature = "__rustls-tls"))]
#![cfg(all(any(feature = "native-tls", feature = "__rustls-tls"), feature = "handshake"))]
use std::{
net::{TcpListener, TcpStream},

@ -1,6 +1,8 @@
//! Verifies that we can read data messages even if we have initiated a close handshake,
//! but before we got confirmation.
#![cfg(feature = "handshake")]
use std::{
net::TcpListener,
process::exit,
@ -8,7 +10,6 @@ use std::{
time::Duration,
};
#[cfg(feature = "handshake")]
use tungstenite::{accept, connect, error::ProtocolError, Error, Message};
use url::Url;

@ -1,6 +1,8 @@
//! Verifies that we can read data messages even if we have initiated a close handshake,
//! but before we got confirmation.
#![cfg(feature = "handshake")]
use std::{
net::TcpListener,
process::exit,
@ -8,7 +10,6 @@ use std::{
time::Duration,
};
#[cfg(feature = "handshake")]
use tungstenite::{accept, connect, Error, Message};
use url::Url;

Loading…
Cancel
Save