mirror of https://github.com/fafhrd91/actix-net
fix tests
This commit is contained in:
parent
01e06a84a5
commit
8ff0f9a37b
|
@ -16,7 +16,7 @@ use crate::{Server, ServerBuilder, ServerHandle, ServerServiceFactory};
|
|||
///
|
||||
/// #[actix_rt::main]
|
||||
/// async fn main() {
|
||||
/// let srv = TestServer::with(|| fn_service(
|
||||
/// let srv = TestServer::start(|| fn_service(
|
||||
/// |sock| async move {
|
||||
/// println!("New connection: {:?}", sock);
|
||||
/// Ok::<_, ()>(())
|
||||
|
|
|
@ -94,7 +94,7 @@ fn rustls_connector(_cert: String, _key: String) -> ClientConfig {
|
|||
async fn accepts_connections() {
|
||||
let (cert, key) = new_cert_and_key();
|
||||
|
||||
let srv = TestServer::with({
|
||||
let srv = TestServer::start({
|
||||
let cert = cert.clone();
|
||||
let key = key.clone();
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ fn openssl_connector(cert: String, key: String) -> SslConnector {
|
|||
async fn accepts_connections() {
|
||||
let (cert, key) = new_cert_and_key();
|
||||
|
||||
let srv = TestServer::with({
|
||||
let srv = TestServer::start({
|
||||
let cert = cert.clone();
|
||||
let key = key.clone();
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ use actix_tls::connect::{ConnectError, ConnectInfo, Connection, Connector, Host}
|
|||
#[cfg(feature = "openssl")]
|
||||
#[actix_rt::test]
|
||||
async fn test_string() {
|
||||
let srv = TestServer::with(|| {
|
||||
let srv = TestServer::start(|| {
|
||||
fn_service(|io: TcpStream| async {
|
||||
let mut framed = Framed::new(io, BytesCodec);
|
||||
framed.send(Bytes::from_static(b"test")).await?;
|
||||
|
@ -34,7 +34,7 @@ async fn test_string() {
|
|||
#[cfg(feature = "rustls")]
|
||||
#[actix_rt::test]
|
||||
async fn test_rustls_string() {
|
||||
let srv = TestServer::with(|| {
|
||||
let srv = TestServer::start(|| {
|
||||
fn_service(|io: TcpStream| async {
|
||||
let mut framed = Framed::new(io, BytesCodec);
|
||||
framed.send(Bytes::from_static(b"test")).await?;
|
||||
|
@ -101,7 +101,7 @@ async fn service_factory() {
|
|||
async fn test_openssl_uri() {
|
||||
use std::convert::TryFrom;
|
||||
|
||||
let srv = TestServer::with(|| {
|
||||
let srv = TestServer::start(|| {
|
||||
fn_service(|io: TcpStream| async {
|
||||
let mut framed = Framed::new(io, BytesCodec);
|
||||
framed.send(Bytes::from_static(b"test")).await?;
|
||||
|
@ -120,7 +120,7 @@ async fn test_openssl_uri() {
|
|||
async fn test_rustls_uri() {
|
||||
use std::convert::TryFrom;
|
||||
|
||||
let srv = TestServer::with(|| {
|
||||
let srv = TestServer::start(|| {
|
||||
fn_service(|io: TcpStream| async {
|
||||
let mut framed = Framed::new(io, BytesCodec);
|
||||
framed.send(Bytes::from_static(b"test")).await?;
|
||||
|
|
Loading…
Reference in New Issue