Skip to content

Commit

Permalink
Fix the select_all::smoke test
Browse files Browse the repository at this point in the history
So that it matches the current behavior.
  • Loading branch information
hcpl authored and cramertj committed Apr 24, 2018
1 parent f484fff commit 1a52eba
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions futures/tests/select_all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@ fn smoke() {
ok(3),
];

// This test depends on an implementation detail of `select_all` to match
// its behavior: it uses `swap_remove` under the hood.

let (i, idx, v) = block_on(select_all(v)).ok().unwrap();
assert_eq!(i, 1);
assert_eq!(idx, 0);

let (i, idx, v) = block_on(select_all(v)).err().unwrap();
assert_eq!(i, 2);
assert_eq!(idx, 0);

let (i, idx, v) = block_on(select_all(v)).ok().unwrap();
assert_eq!(i, 3);
assert_eq!(idx, 0);

let (i, idx, v) = block_on(select_all(v)).err().unwrap();
assert_eq!(i, 2);
assert_eq!(idx, 0);

assert!(v.is_empty());
}

0 comments on commit 1a52eba

Please sign in to comment.