summaryrefslogtreecommitdiffstats
path: root/vendor/crossbeam/tests/subcrates.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /vendor/crossbeam/tests/subcrates.rs
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--vendor/crossbeam/tests/subcrates.rs47
1 files changed, 47 insertions, 0 deletions
diff --git a/vendor/crossbeam/tests/subcrates.rs b/vendor/crossbeam/tests/subcrates.rs
new file mode 100644
index 000000000..21b99fb0e
--- /dev/null
+++ b/vendor/crossbeam/tests/subcrates.rs
@@ -0,0 +1,47 @@
+//! Makes sure subcrates are properly re-exported.
+
+use crossbeam::select;
+
+#[test]
+fn channel() {
+ let (s, r) = crossbeam::channel::bounded(1);
+
+ select! {
+ send(s, 0) -> res => res.unwrap(),
+ recv(r) -> res => assert!(res.is_ok()),
+ }
+}
+
+#[test]
+fn deque() {
+ let w = crossbeam::deque::Worker::new_fifo();
+ w.push(1);
+ let _ = w.pop();
+}
+
+#[test]
+fn epoch() {
+ crossbeam::epoch::pin();
+}
+
+#[test]
+fn queue() {
+ let a = crossbeam::queue::ArrayQueue::new(10);
+ let _ = a.push(1);
+ let _ = a.pop();
+}
+
+#[test]
+fn utils() {
+ crossbeam::utils::CachePadded::new(7);
+
+ crossbeam::scope(|scope| {
+ scope.spawn(|_| ());
+ })
+ .unwrap();
+
+ crossbeam::thread::scope(|scope| {
+ scope.spawn(|_| ());
+ })
+ .unwrap();
+}