@@ -3,80 +3,80 @@ use ticked_async_executor::TickedAsyncExecutor;
33
44const DELTA : f64 = 1000.0 / 60.0 ;
55
6- #[ test]
7- fn test_futures_join ( ) {
8- let executor = TickedAsyncExecutor :: default ( ) ;
6+ // #[test]
7+ // fn test_futures_join() {
8+ // let executor = TickedAsyncExecutor::default();
99
10- let ( mut tx1, mut rx1) = futures:: channel:: mpsc:: channel :: < usize > ( 1 ) ;
11- let ( mut tx2, mut rx2) = futures:: channel:: mpsc:: channel :: < usize > ( 1 ) ;
12- executor
13- . spawn_local ( "ThreadedFuture" , async move {
14- let ( a, b) = futures:: join!( rx1. next( ) , rx2. next( ) ) ;
15- assert_eq ! ( a. unwrap( ) , 10 ) ;
16- assert_eq ! ( b. unwrap( ) , 20 ) ;
17- } )
18- . detach ( ) ;
10+ // let (mut tx1, mut rx1) = futures::channel::mpsc::channel::<usize>(1);
11+ // let (mut tx2, mut rx2) = futures::channel::mpsc::channel::<usize>(1);
12+ // executor
13+ // .spawn_local("ThreadedFuture", async move {
14+ // let (a, b) = futures::join!(rx1.next(), rx2.next());
15+ // assert_eq!(a.unwrap(), 10);
16+ // assert_eq!(b.unwrap(), 20);
17+ // })
18+ // .detach();
1919
20- let ( mut tx3, mut rx3) = futures:: channel:: mpsc:: channel :: < usize > ( 1 ) ;
21- let ( mut tx4, mut rx4) = futures:: channel:: mpsc:: channel :: < usize > ( 1 ) ;
22- executor
23- . spawn_local ( "LocalFuture" , async move {
24- let ( a, b) = futures:: join!( rx3. next( ) , rx4. next( ) ) ;
25- assert_eq ! ( a. unwrap( ) , 10 ) ;
26- assert_eq ! ( b. unwrap( ) , 20 ) ;
27- } )
28- . detach ( ) ;
20+ // let (mut tx3, mut rx3) = futures::channel::mpsc::channel::<usize>(1);
21+ // let (mut tx4, mut rx4) = futures::channel::mpsc::channel::<usize>(1);
22+ // executor
23+ // .spawn_local("LocalFuture", async move {
24+ // let (a, b) = futures::join!(rx3.next(), rx4.next());
25+ // assert_eq!(a.unwrap(), 10);
26+ // assert_eq!(b.unwrap(), 20);
27+ // })
28+ // .detach();
2929
30- tx1. try_send ( 10 ) . unwrap ( ) ;
31- tx3. try_send ( 10 ) . unwrap ( ) ;
32- for _ in 0 ..10 {
33- executor. tick ( DELTA ) ;
34- }
35- tx2. try_send ( 20 ) . unwrap ( ) ;
36- tx4. try_send ( 20 ) . unwrap ( ) ;
30+ // tx1.try_send(10).unwrap();
31+ // tx3.try_send(10).unwrap();
32+ // for _ in 0..10 {
33+ // executor.tick(DELTA);
34+ // }
35+ // tx2.try_send(20).unwrap();
36+ // tx4.try_send(20).unwrap();
3737
38- while executor. num_tasks ( ) != 0 {
39- executor. tick ( DELTA ) ;
40- }
41- }
38+ // while executor.num_tasks() != 0 {
39+ // executor.tick(DELTA);
40+ // }
41+ // }
4242
43- #[ test]
44- fn test_futures_select ( ) {
45- let executor = TickedAsyncExecutor :: default ( ) ;
43+ // #[test]
44+ // fn test_futures_select() {
45+ // let executor = TickedAsyncExecutor::default();
4646
47- let ( mut tx1, mut rx1) = futures:: channel:: mpsc:: channel :: < usize > ( 1 ) ;
48- let ( _tx2, mut rx2) = futures:: channel:: mpsc:: channel :: < usize > ( 1 ) ;
49- executor
50- . spawn_local ( "ThreadedFuture" , async move {
51- futures:: select! {
52- data = rx1. next( ) => {
53- assert_eq!( data. unwrap( ) , 10 ) ;
54- }
55- _ = rx2. next( ) => { }
56- }
57- } )
58- . detach ( ) ;
47+ // let (mut tx1, mut rx1) = futures::channel::mpsc::channel::<usize>(1);
48+ // let (_tx2, mut rx2) = futures::channel::mpsc::channel::<usize>(1);
49+ // executor
50+ // .spawn_local("ThreadedFuture", async move {
51+ // futures::select! {
52+ // data = rx1.next() => {
53+ // assert_eq!(data.unwrap(), 10);
54+ // }
55+ // _ = rx2.next() => {}
56+ // }
57+ // })
58+ // .detach();
5959
60- let ( mut tx3, mut rx3) = futures:: channel:: mpsc:: channel :: < usize > ( 1 ) ;
61- let ( _tx4, mut rx4) = futures:: channel:: mpsc:: channel :: < usize > ( 1 ) ;
62- executor
63- . spawn_local ( "LocalFuture" , async move {
64- futures:: select! {
65- data = rx3. next( ) => {
66- assert_eq!( data. unwrap( ) , 10 ) ;
67- }
68- _ = rx4. next( ) => { }
69- }
70- } )
71- . detach ( ) ;
60+ // let (mut tx3, mut rx3) = futures::channel::mpsc::channel::<usize>(1);
61+ // let (_tx4, mut rx4) = futures::channel::mpsc::channel::<usize>(1);
62+ // executor
63+ // .spawn_local("LocalFuture", async move {
64+ // futures::select! {
65+ // data = rx3.next() => {
66+ // assert_eq!(data.unwrap(), 10);
67+ // }
68+ // _ = rx4.next() => {}
69+ // }
70+ // })
71+ // .detach();
7272
73- for _ in 0 ..10 {
74- executor. tick ( DELTA ) ;
75- }
73+ // for _ in 0..10 {
74+ // executor.tick(DELTA);
75+ // }
7676
77- tx1. try_send ( 10 ) . unwrap ( ) ;
78- tx3. try_send ( 10 ) . unwrap ( ) ;
79- while executor. num_tasks ( ) != 0 {
80- executor. tick ( DELTA ) ;
81- }
82- }
77+ // tx1.try_send(10).unwrap();
78+ // tx3.try_send(10).unwrap();
79+ // while executor.num_tasks() != 0 {
80+ // executor.tick(DELTA);
81+ // }
82+ // }
0 commit comments