From 1b6a04ca5504955c571d1c97504fb45ea0befee4 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Mon, 8 Jan 2024 01:21:28 +0400 Subject: Initial vendor packages Signed-off-by: Valentin Popov --- vendor/flume/tests/same_channel.rs | 114 +++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 vendor/flume/tests/same_channel.rs (limited to 'vendor/flume/tests/same_channel.rs') diff --git a/vendor/flume/tests/same_channel.rs b/vendor/flume/tests/same_channel.rs new file mode 100644 index 0000000..c6452ec --- /dev/null +++ b/vendor/flume/tests/same_channel.rs @@ -0,0 +1,114 @@ +// extern crate crossbeam_channel; + +// use std::time::Duration; + +// use crossbeam_channel::{after, bounded, never, tick, unbounded}; + +// fn ms(ms: u64) -> Duration { +// Duration::from_millis(ms) +// } + +// #[test] +// fn after_same_channel() { +// let r = after(ms(50)); + +// let r2 = r.clone(); +// assert!(r.same_channel(&r2)); + +// let r3 = after(ms(50)); +// assert!(!r.same_channel(&r3)); +// assert!(!r2.same_channel(&r3)); + +// let r4 = after(ms(100)); +// assert!(!r.same_channel(&r4)); +// assert!(!r2.same_channel(&r4)); +// } + +// #[test] +// fn array_same_channel() { +// let (s, r) = bounded::(1); + +// let s2 = s.clone(); +// assert!(s.same_channel(&s2)); + +// let r2 = r.clone(); +// assert!(r.same_channel(&r2)); + +// let (s3, r3) = bounded::(1); +// assert!(!s.same_channel(&s3)); +// assert!(!s2.same_channel(&s3)); +// assert!(!r.same_channel(&r3)); +// assert!(!r2.same_channel(&r3)); +// } + +// #[test] +// fn list_same_channel() { +// let (s, r) = unbounded::(); + +// let s2 = s.clone(); +// assert!(s.same_channel(&s2)); + +// let r2 = r.clone(); +// assert!(r.same_channel(&r2)); + +// let (s3, r3) = unbounded::(); +// assert!(!s.same_channel(&s3)); +// assert!(!s2.same_channel(&s3)); +// assert!(!r.same_channel(&r3)); +// assert!(!r2.same_channel(&r3)); +// } + +// #[test] +// fn never_same_channel() { +// let r = never::(); + +// let r2 = r.clone(); +// assert!(r.same_channel(&r2)); + +// // Never channel are always equal to one another. +// let r3 = never::(); +// assert!(r.same_channel(&r3)); +// assert!(r2.same_channel(&r3)); +// } + +// #[test] +// fn tick_same_channel() { +// let r = tick(ms(50)); + +// let r2 = r.clone(); +// assert!(r.same_channel(&r2)); + +// let r3 = tick(ms(50)); +// assert!(!r.same_channel(&r3)); +// assert!(!r2.same_channel(&r3)); + +// let r4 = tick(ms(100)); +// assert!(!r.same_channel(&r4)); +// assert!(!r2.same_channel(&r4)); +// } + +// #[test] +// fn zero_same_channel() { +// let (s, r) = bounded::(0); + +// let s2 = s.clone(); +// assert!(s.same_channel(&s2)); + +// let r2 = r.clone(); +// assert!(r.same_channel(&r2)); + +// let (s3, r3) = bounded::(0); +// assert!(!s.same_channel(&s3)); +// assert!(!s2.same_channel(&s3)); +// assert!(!r.same_channel(&r3)); +// assert!(!r2.same_channel(&r3)); +// } + +// #[test] +// fn different_flavors_same_channel() { +// let (s1, r1) = bounded::(0); +// let (s2, r2) = unbounded::(); + +// assert!(!s1.same_channel(&s2)); +// assert!(!r1.same_channel(&r2)); +// } -- cgit v1.2.3