We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c7460b2 commit 7b77f53Copy full SHA for 7b77f53
src/future.rs
@@ -181,14 +181,23 @@ mod tests {
181
}
182
183
#[test]
184
- fn test_and_then() {
+ fn test_and_then_ok() {
185
executor::block_on(async {
186
let future = ready(Ok::<i32, i32>(1));
187
let new_future = and_then(future, |x| ready(Ok::<i32, i32>(x + 3)));
188
assert_eq!(new_future.await, Ok(4));
189
});
190
191
192
+ #[test]
193
+ fn test_and_then_err() {
194
+ executor::block_on(async {
195
+ let future = ready(Err::<i32, i32>(1));
196
+ let new_future = and_then(future, |x| ready(Ok::<i32, i32>(x + 3)));
197
+ assert_eq!(new_future.await, Err(1));
198
+ });
199
+ }
200
+
201
202
fn test_or_else() {
203
0 commit comments