summaryrefslogtreecommitdiffstats
path: root/vendor/crossbeam/tests/subcrates.rs
blob: 21b99fb0eb613f5413008bd69dabd88f857a2428 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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();
}