mirror of
https://github.com/actix/actix-web.git
synced 2024-11-27 12:01:15 +00:00
commit
8fe30a5b66
1 changed files with 10 additions and 2 deletions
|
@ -59,13 +59,14 @@ const STR: &str = "Hello World Hello World Hello World Hello World Hello World \
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
fn test_start() {
|
fn test_start() {
|
||||||
use std::{mpsc, net};
|
use std::sync::mpsc;
|
||||||
|
use actix::System;
|
||||||
|
|
||||||
let _ = test::TestServer::unused_addr();
|
let _ = test::TestServer::unused_addr();
|
||||||
let (tx, rx) = mpsc::channel();
|
let (tx, rx) = mpsc::channel();
|
||||||
|
|
||||||
thread::spawn(|| {
|
thread::spawn(|| {
|
||||||
actix::System::run(move || {
|
System::run(move || {
|
||||||
let srv = server::new(|| {
|
let srv = server::new(|| {
|
||||||
vec![App::new().resource("/", |r| {
|
vec![App::new().resource("/", |r| {
|
||||||
r.method(http::Method::GET).f(|_| HttpResponse::Ok())
|
r.method(http::Method::GET).f(|_| HttpResponse::Ok())
|
||||||
|
@ -118,6 +119,10 @@ fn test_start() {
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
fn test_shutdown() {
|
fn test_shutdown() {
|
||||||
|
use std::sync::mpsc;
|
||||||
|
use std::net;
|
||||||
|
use actix::System;
|
||||||
|
|
||||||
let _ = test::TestServer::unused_addr();
|
let _ = test::TestServer::unused_addr();
|
||||||
let (tx, rx) = mpsc::channel();
|
let (tx, rx) = mpsc::channel();
|
||||||
|
|
||||||
|
@ -157,6 +162,9 @@ fn test_shutdown() {
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
fn test_panic() {
|
fn test_panic() {
|
||||||
|
use std::sync::mpsc;
|
||||||
|
use actix::System;
|
||||||
|
|
||||||
let _ = test::TestServer::unused_addr();
|
let _ = test::TestServer::unused_addr();
|
||||||
let (tx, rx) = mpsc::channel();
|
let (tx, rx) = mpsc::channel();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue