File tree Expand file tree Collapse file tree 2 files changed +26
-22
lines changed Expand file tree Collapse file tree 2 files changed +26
-22
lines changed Original file line number Diff line number Diff line change @@ -318,7 +318,9 @@ where
318
318
}
319
319
Ok ( vec ! [ ] )
320
320
}
321
- Step :: Established ( ( ..) ) => todo ! ( ) ,
321
+ Step :: Established ( _) => {
322
+ unreachable ! ( "`handle_setup_message` should never be called when Step::Established" )
323
+ }
322
324
}
323
325
}
324
326
#[ instrument( skip_all) ]
Original file line number Diff line number Diff line change @@ -97,27 +97,6 @@ pub(crate) fn log() {
97
97
} ) ;
98
98
}
99
99
100
- #[ tokio:: test]
101
- async fn way_one ( ) {
102
- use futures:: SinkExt ;
103
- let mut a = Io :: default ( ) ;
104
- let _ = a. send ( b"hello" . into ( ) ) . await ;
105
- let Some ( res) = a. next ( ) . await else { panic ! ( ) } ;
106
- assert_eq ! ( res, b"hello" ) ;
107
- }
108
-
109
- #[ tokio:: test]
110
- async fn split ( ) {
111
- use futures:: SinkExt ;
112
- let ( mut left, mut right) = ( TwoWay :: default ( ) ) . split_sides ( ) ;
113
-
114
- left. send ( b"hello" . to_vec ( ) ) . await . unwrap ( ) ;
115
- let Some ( res) = right. next ( ) . await else {
116
- panic ! ( ) ;
117
- } ;
118
- assert_eq ! ( res, b"hello" ) ;
119
- }
120
-
121
100
pub ( crate ) struct Moo < Rx , Tx > {
122
101
receiver : Rx ,
123
102
sender : Tx ,
@@ -199,3 +178,26 @@ pub(crate) fn create_result_connected() -> (
199
178
let b = Moo :: from ( result_channel ( ) ) ;
200
179
a. connect ( b)
201
180
}
181
+
182
+ #[ cfg( test) ]
183
+ mod test_test_utils {
184
+ use super :: * ;
185
+ use futures:: SinkExt ;
186
+ #[ tokio:: test]
187
+ async fn way_one ( ) {
188
+ let mut a = Io :: default ( ) ;
189
+ let _ = a. send ( b"hello" . into ( ) ) . await ;
190
+ let Some ( res) = a. next ( ) . await else { panic ! ( ) } ;
191
+ assert_eq ! ( res, b"hello" ) ;
192
+ }
193
+
194
+ #[ tokio:: test]
195
+ async fn split ( ) {
196
+ let ( mut left, mut right) = ( TwoWay :: default ( ) ) . split_sides ( ) ;
197
+ left. send ( b"hello" . to_vec ( ) ) . await . unwrap ( ) ;
198
+ let Some ( res) = right. next ( ) . await else {
199
+ panic ! ( ) ;
200
+ } ;
201
+ assert_eq ! ( res, b"hello" ) ;
202
+ }
203
+ }
You can’t perform that action at this time.
0 commit comments