first pass of merging in warp (doesn't build)

This commit is contained in:
Ryan Ward
2026-07-01 16:08:58 -05:00
parent 2f64909469
commit 4770ac06b5
3662 changed files with 414574 additions and 89772 deletions
+6 -4
View File
@@ -1,13 +1,15 @@
use crate::on_cancel::OnCancelFutureExt;
use futures_util::future::{AbortHandle, Abortable, Aborted};
use std::sync::atomic::{AtomicBool, Ordering};
use futures_util::future::{AbortHandle, Abortable, Aborted};
use crate::on_cancel::OnCancelFutureExt;
#[test]
fn test_ready_future_doesnt_call_callback() {
let callback_called = AtomicBool::new(false);
let future = async {}.on_cancel(|| callback_called.store(true, Ordering::SeqCst));
galaxyui::r#async::block_on(future);
galaxyui_core::r#async::block_on(future);
assert!(!callback_called.load(Ordering::Relaxed));
}
@@ -24,7 +26,7 @@ fn test_aborted_future_calls_callback() {
// Abort the future before it is ever polled.
handle.abort();
let future_result = galaxyui::r#async::block_on(future);
let future_result = galaxyui_core::r#async::block_on(future);
// The future should be aborted and the callback should have been called.
assert_eq!(future_result, Err(Aborted));