• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #[test]
smoke()2 fn smoke() {
3     use futures::executor::block_on;
4     use futures::future::{ready, select_all};
5     use std::collections::HashSet;
6 
7     let v = vec![
8         ready(1),
9         ready(2),
10         ready(3),
11     ];
12 
13     let mut c = vec![1, 2, 3].into_iter().collect::<HashSet<_>>();
14 
15     let (i, idx, v) = block_on(select_all(v));
16     assert!(c.remove(&i));
17     assert_eq!(idx, 0);
18 
19     let (i, idx, v) = block_on(select_all(v));
20     assert!(c.remove(&i));
21     assert_eq!(idx, 0);
22 
23     let (i, idx, v) = block_on(select_all(v));
24     assert!(c.remove(&i));
25     assert_eq!(idx, 0);
26 
27     assert!(c.is_empty());
28     assert!(v.is_empty());
29 }
30