diff --git a/tests/runtime-async/async/future-cancel-read/test.rs b/tests/runtime-async/async/future-cancel-read/test.rs index 8a6cbacbd..21c24698f 100644 --- a/tests/runtime-async/async/future-cancel-read/test.rs +++ b/tests/runtime-async/async/future-cancel-read/test.rs @@ -28,16 +28,13 @@ impl crate::exports::my::test::i::Guest for Component { } async fn start_read_then_cancel() { - // FIXME(wasip3-prototyping#137) - if false { - let (tx, rx) = wit_future::new::(); - let mut read = Box::pin(rx.into_future()); - assert!(read - .as_mut() - .poll(&mut Context::from_waker(noop_waker_ref())) - .is_pending()); - drop(tx); - assert!(read.as_mut().cancel().unwrap().is_none()); - } + let (tx, rx) = wit_future::new::(); + let mut read = Box::pin(rx.into_future()); + assert!(read + .as_mut() + .poll(&mut Context::from_waker(noop_waker_ref())) + .is_pending()); + drop(tx); + assert!(read.as_mut().cancel().unwrap().is_none()); } } diff --git a/tests/runtime-async/async/future-cancel-write/runner.rs b/tests/runtime-async/async/future-cancel-write/runner.rs index 833878fea..16c16bd85 100644 --- a/tests/runtime-async/async/future-cancel-write/runner.rs +++ b/tests/runtime-async/async/future-cancel-write/runner.rs @@ -40,39 +40,31 @@ fn main() { }; // cancel after we hit the intrinsic and then close the other end - // - // FIXME(wasip3-prototyping#137) - if false { - let (tx, rx) = wit_future::new::(); - let mut future = Box::pin(tx.write("hello3".into())); - assert!(future - .as_mut() - .poll(&mut Context::from_waker(noop_waker_ref())) - .is_pending()); - drop(rx); - match future.as_mut().cancel() { - FutureWriteCancel::Closed(val) => assert_eq!(val, "hello3"), - other => panic!("expected closed, got: {other:?}"), - }; - } + let (tx, rx) = wit_future::new::(); + let mut future = Box::pin(tx.write("hello3".into())); + assert!(future + .as_mut() + .poll(&mut Context::from_waker(noop_waker_ref())) + .is_pending()); + drop(rx); + match future.as_mut().cancel() { + FutureWriteCancel::Closed(val) => assert_eq!(val, "hello3"), + other => panic!("expected closed, got: {other:?}"), + }; // Start a write, wait for it to be pending, then go complete the write // in some async work, then cancel it and witness that it was written, // not cancelled. - // - // FIXME(wasip3-prototyping#138) - if false { - let (tx, rx) = wit_future::new::(); - let mut future = Box::pin(tx.write("hello3".into())); - assert!(future - .as_mut() - .poll(&mut Context::from_waker(noop_waker_ref())) - .is_pending()); - read_and_drop(rx).await; - match future.as_mut().cancel() { - FutureWriteCancel::AlreadySent => {} - other => panic!("expected sent, got: {other:?}"), - }; - } + let (tx, rx) = wit_future::new::(); + let mut future = Box::pin(tx.write("hello3".into())); + assert!(future + .as_mut() + .poll(&mut Context::from_waker(noop_waker_ref())) + .is_pending()); + read_and_drop(rx).await; + match future.as_mut().cancel() { + FutureWriteCancel::AlreadySent => {} + other => panic!("expected sent, got: {other:?}"), + }; }); }