@@ -40,39 +40,31 @@ fn main() {
4040 } ;
4141
4242 // cancel after we hit the intrinsic and then close the other end
43- //
44- // FIXME(wasip3-prototyping#137)
45- if false {
46- let ( tx, rx) = wit_future:: new :: < String > ( ) ;
47- let mut future = Box :: pin ( tx. write ( "hello3" . into ( ) ) ) ;
48- assert ! ( future
49- . as_mut( )
50- . poll( & mut Context :: from_waker( noop_waker_ref( ) ) )
51- . is_pending( ) ) ;
52- drop ( rx) ;
53- match future. as_mut ( ) . cancel ( ) {
54- FutureWriteCancel :: Closed ( val) => assert_eq ! ( val, "hello3" ) ,
55- other => panic ! ( "expected closed, got: {other:?}" ) ,
56- } ;
57- }
43+ let ( tx, rx) = wit_future:: new :: < String > ( ) ;
44+ let mut future = Box :: pin ( tx. write ( "hello3" . into ( ) ) ) ;
45+ assert ! ( future
46+ . as_mut( )
47+ . poll( & mut Context :: from_waker( noop_waker_ref( ) ) )
48+ . is_pending( ) ) ;
49+ drop ( rx) ;
50+ match future. as_mut ( ) . cancel ( ) {
51+ FutureWriteCancel :: Closed ( val) => assert_eq ! ( val, "hello3" ) ,
52+ other => panic ! ( "expected closed, got: {other:?}" ) ,
53+ } ;
5854
5955 // Start a write, wait for it to be pending, then go complete the write
6056 // in some async work, then cancel it and witness that it was written,
6157 // not cancelled.
62- //
63- // FIXME(wasip3-prototyping#138)
64- if false {
65- let ( tx, rx) = wit_future:: new :: < String > ( ) ;
66- let mut future = Box :: pin ( tx. write ( "hello3" . into ( ) ) ) ;
67- assert ! ( future
68- . as_mut( )
69- . poll( & mut Context :: from_waker( noop_waker_ref( ) ) )
70- . is_pending( ) ) ;
71- read_and_drop ( rx) . await ;
72- match future. as_mut ( ) . cancel ( ) {
73- FutureWriteCancel :: AlreadySent => { }
74- other => panic ! ( "expected sent, got: {other:?}" ) ,
75- } ;
76- }
58+ let ( tx, rx) = wit_future:: new :: < String > ( ) ;
59+ let mut future = Box :: pin ( tx. write ( "hello3" . into ( ) ) ) ;
60+ assert ! ( future
61+ . as_mut( )
62+ . poll( & mut Context :: from_waker( noop_waker_ref( ) ) )
63+ . is_pending( ) ) ;
64+ read_and_drop ( rx) . await ;
65+ match future. as_mut ( ) . cancel ( ) {
66+ FutureWriteCancel :: AlreadySent => { }
67+ other => panic ! ( "expected sent, got: {other:?}" ) ,
68+ } ;
7769 } ) ;
7870}
0 commit comments