1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#![forbid(unsafe_code)]
#![deny(
clippy::dbg_macro,
missing_copy_implementations,
rustdoc::missing_crate_level_docs,
missing_debug_implementations,
missing_docs,
nonstandard_style,
unused_qualifications
)]
mod assertions;
mod test_transport;
pub use test_transport::TestTransport;
mod test_conn;
pub use test_conn::TestConn;
mod with_server;
pub use with_server::{with_server, with_socket};
pub mod methods;
pub mod prelude {
pub use crate::{
assert_body, assert_body_contains, assert_headers, assert_not_handled, assert_ok,
assert_response, assert_status, block_on, init, methods::*,
};
pub use trillium::{Conn, Method, Status};
}
pub use trillium::{Method, Status};
pub use url::Url;
pub fn init(handler: &mut impl trillium::Handler) {
let mut info = "testing".into();
block_on(handler.init(&mut info))
}
pub use futures_lite;
pub use futures_lite::{AsyncRead, AsyncReadExt, AsyncWrite};
cfg_if::cfg_if! {
if #[cfg(feature = "tokio")] {
pub use trillium_tokio::block_on;
} else if #[cfg(feature = "async-std")] {
pub use trillium_async_std::async_std::task::block_on;
} else if #[cfg(feature = "smol")] {
pub use trillium_smol::async_global_executor::block_on;
} else {
pub use futures_lite::future::block_on;
}
}