summaryrefslogtreecommitdiffstats
path: root/vendor/futures/tests_disabled
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
commit1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch)
tree3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /vendor/futures/tests_disabled
parentReleasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz
rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/futures/tests_disabled')
-rw-r--r--vendor/futures/tests_disabled/bilock.rs102
-rw-r--r--vendor/futures/tests_disabled/stream.rs1
2 files changed, 0 insertions, 103 deletions
diff --git a/vendor/futures/tests_disabled/bilock.rs b/vendor/futures/tests_disabled/bilock.rs
deleted file mode 100644
index 0166ca48b..000000000
--- a/vendor/futures/tests_disabled/bilock.rs
+++ /dev/null
@@ -1,102 +0,0 @@
-use futures::future;
-use futures::stream;
-use futures::task;
-use futures_util::lock::BiLock;
-use std::thread;
-
-// mod support;
-// use support::*;
-
-#[test]
-fn smoke() {
- let future = future::lazy(|_| {
- let (a, b) = BiLock::new(1);
-
- {
- let mut lock = match a.poll_lock() {
- Poll::Ready(l) => l,
- Poll::Pending => panic!("poll not ready"),
- };
- assert_eq!(*lock, 1);
- *lock = 2;
-
- assert!(b.poll_lock().is_pending());
- assert!(a.poll_lock().is_pending());
- }
-
- assert!(b.poll_lock().is_ready());
- assert!(a.poll_lock().is_ready());
-
- {
- let lock = match b.poll_lock() {
- Poll::Ready(l) => l,
- Poll::Pending => panic!("poll not ready"),
- };
- assert_eq!(*lock, 2);
- }
-
- assert_eq!(a.reunite(b).expect("bilock/smoke: reunite error"), 2);
-
- Ok::<(), ()>(())
- });
-
- assert!(task::spawn(future)
- .poll_future_notify(&notify_noop(), 0)
- .expect("failure in poll")
- .is_ready());
-}
-
-#[test]
-fn concurrent() {
- const N: usize = 10000;
- let (a, b) = BiLock::new(0);
-
- let a = Increment { a: Some(a), remaining: N };
- let b = stream::iter_ok(0..N).fold(b, |b, _n| {
- b.lock().map(|mut b| {
- *b += 1;
- b.unlock()
- })
- });
-
- let t1 = thread::spawn(move || a.wait());
- let b = b.wait().expect("b error");
- let a = t1.join().unwrap().expect("a error");
-
- match a.poll_lock() {
- Poll::Ready(l) => assert_eq!(*l, 2 * N),
- Poll::Pending => panic!("poll not ready"),
- }
- match b.poll_lock() {
- Poll::Ready(l) => assert_eq!(*l, 2 * N),
- Poll::Pending => panic!("poll not ready"),
- }
-
- assert_eq!(a.reunite(b).expect("bilock/concurrent: reunite error"), 2 * N);
-
- struct Increment {
- remaining: usize,
- a: Option<BiLock<usize>>,
- }
-
- impl Future for Increment {
- type Item = BiLock<usize>;
- type Error = ();
-
- fn poll(&mut self) -> Poll<BiLock<usize>, ()> {
- loop {
- if self.remaining == 0 {
- return Ok(self.a.take().unwrap().into());
- }
-
- let a = self.a.as_ref().unwrap();
- let mut a = match a.poll_lock() {
- Poll::Ready(l) => l,
- Poll::Pending => return Ok(Poll::Pending),
- };
- self.remaining -= 1;
- *a += 1;
- }
- }
- }
-}
diff --git a/vendor/futures/tests_disabled/stream.rs b/vendor/futures/tests_disabled/stream.rs
index 854dbad82..a4eec2c7a 100644
--- a/vendor/futures/tests_disabled/stream.rs
+++ b/vendor/futures/tests_disabled/stream.rs
@@ -318,7 +318,6 @@ fn forward() {
}
#[test]
-#[allow(deprecated)]
fn concat() {
let a = iter_ok::<_, ()>(vec![vec![1, 2, 3], vec![4, 5, 6], vec![7, 8, 9]]);
assert_done(move || a.concat(), Ok(vec![1, 2, 3, 4, 5, 6, 7, 8, 9]));