@@ -5,6 +5,14 @@ use http_types::{Body, Request, Response, Url};
5
5
6
6
use cfg_if:: cfg_if;
7
7
8
+ cfg_if ! {
9
+ if #[ cfg( not( feature = "hyper_client" ) ) ] {
10
+ use async_std:: test as atest;
11
+ } else {
12
+ use tokio:: test as atest;
13
+ }
14
+ }
15
+
8
16
cfg_if ! {
9
17
if #[ cfg( feature = "curl_client" ) ] {
10
18
use http_client:: isahc:: IsahcClient as DefaultClient ;
@@ -17,7 +25,7 @@ cfg_if! {
17
25
}
18
26
}
19
27
20
- #[ async_std :: test ]
28
+ #[ atest ]
21
29
async fn post_json ( ) -> Result < ( ) , http_types:: Error > {
22
30
#[ derive( serde:: Deserialize , serde:: Serialize ) ]
23
31
struct Cat {
@@ -45,7 +53,7 @@ async fn post_json() -> Result<(), http_types::Error> {
45
53
Ok ( ( ) )
46
54
}
47
55
48
- #[ async_std :: test ]
56
+ #[ atest ]
49
57
async fn get_json ( ) -> Result < ( ) , http_types:: Error > {
50
58
#[ derive( serde:: Deserialize ) ]
51
59
struct Message {
@@ -66,7 +74,7 @@ async fn get_json() -> Result<(), http_types::Error> {
66
74
Ok ( ( ) )
67
75
}
68
76
69
- #[ async_std :: test ]
77
+ #[ atest ]
70
78
async fn get_google ( ) -> Result < ( ) , http_types:: Error > {
71
79
let url = "https://www.google.com" ;
72
80
let req = Request :: new ( http_types:: Method :: Get , Url :: parse ( url) . unwrap ( ) ) ;
@@ -90,7 +98,7 @@ async fn get_google() -> Result<(), http_types::Error> {
90
98
Ok ( ( ) )
91
99
}
92
100
93
- #[ async_std :: test ]
101
+ #[ atest ]
94
102
async fn get_github ( ) -> Result < ( ) , http_types:: Error > {
95
103
let url = "https://raw.githubusercontent.com/http-rs/surf/6627d9fc15437aea3c0a69e0b620ae7769ea6765/LICENSE-MIT" ;
96
104
let req = Request :: new ( http_types:: Method :: Get , Url :: parse ( url) . unwrap ( ) ) ;
0 commit comments