Skip to content

Commit 55ca2ce

Browse files
committed
delete #[test]s from streams
1 parent cf3a578 commit 55ca2ce

File tree

4 files changed

+0
-136
lines changed

4 files changed

+0
-136
lines changed

src/stream/buffer.rs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -98,44 +98,3 @@ impl<S: Stream, I: Stream> Stream for Buffer<S, I> {
9898
}
9999
}
100100
}
101-
102-
#[cfg(test)]
103-
mod test {
104-
use crate::prelude::*;
105-
use crate::time::Duration;
106-
use futures_lite::prelude::*;
107-
108-
#[test]
109-
fn buffer_all_values() {
110-
crate::runtime::block_on(async {
111-
let interval = Duration::from_millis(5);
112-
let buffer = Duration::from_millis(20);
113-
114-
let mut counter = 0;
115-
crate::stream::interval(interval)
116-
.take(10)
117-
.buffer(buffer)
118-
.for_each(|buf| counter += buf.len())
119-
.await;
120-
121-
assert_eq!(counter, 10);
122-
})
123-
}
124-
125-
#[test]
126-
fn no_debounces_hit() {
127-
crate::runtime::block_on(async {
128-
let interval = Duration::from_millis(20);
129-
let buffer = Duration::from_millis(10);
130-
131-
let mut counter = 0;
132-
crate::stream::interval(interval)
133-
.take(10)
134-
.buffer(buffer)
135-
.for_each(|buf| counter += buf.len())
136-
.await;
137-
138-
assert_eq!(counter, 10);
139-
})
140-
}
141-
}

src/stream/debounce.rs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -102,44 +102,3 @@ where
102102
}
103103
}
104104
}
105-
106-
#[cfg(test)]
107-
mod test {
108-
use crate::prelude::*;
109-
use crate::time::Duration;
110-
use futures_lite::prelude::*;
111-
112-
#[test]
113-
fn all_values_debounce() {
114-
crate::runtime::block_on(async {
115-
let interval = Duration::from_millis(10);
116-
let debounce = Duration::from_millis(20);
117-
118-
let mut counter = 0;
119-
crate::stream::interval(interval)
120-
.take(10)
121-
.debounce(debounce)
122-
.for_each(|_| counter += 1)
123-
.await;
124-
125-
assert_eq!(counter, 1);
126-
})
127-
}
128-
129-
#[test]
130-
fn no_debounces_hit() {
131-
crate::runtime::block_on(async {
132-
let interval = Duration::from_millis(40);
133-
let debounce = Duration::from_millis(10);
134-
135-
let mut counter = 0;
136-
crate::stream::interval(interval)
137-
.take(10)
138-
.debounce(debounce)
139-
.for_each(|_| counter += 1)
140-
.await;
141-
142-
assert_eq!(counter, 10);
143-
})
144-
}
145-
}

src/stream/sample.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -97,30 +97,3 @@ impl<S: Stream, I: Stream> Stream for Sample<S, I> {
9797
}
9898
}
9999
}
100-
101-
#[cfg(test)]
102-
mod test {
103-
use crate::prelude::*;
104-
use crate::time::Duration;
105-
use futures_lite::prelude::*;
106-
107-
#[test]
108-
fn smoke() {
109-
crate::runtime::block_on(async {
110-
let interval = Duration::from_millis(100);
111-
let throttle = Duration::from_millis(200);
112-
113-
let take = 4;
114-
let expected = 2;
115-
116-
let mut counter = 0;
117-
crate::stream::interval(interval)
118-
.take(take)
119-
.sample(throttle)
120-
.for_each(|_| counter += 1)
121-
.await;
122-
123-
assert_eq!(counter, expected);
124-
})
125-
}
126-
}

src/stream/throttle.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -100,30 +100,3 @@ impl<S: Stream, I: Stream> Stream for Throttle<S, I> {
100100
}
101101
}
102102
}
103-
104-
#[cfg(test)]
105-
mod test {
106-
use crate::prelude::*;
107-
use crate::time::Duration;
108-
use futures_lite::prelude::*;
109-
110-
#[test]
111-
fn smoke() {
112-
crate::runtime::block_on(async {
113-
let interval = Duration::from_millis(100);
114-
let throttle = Duration::from_millis(300);
115-
116-
let take = 4;
117-
let expected = 2;
118-
119-
let mut counter = 0;
120-
crate::stream::interval(interval)
121-
.take(take)
122-
.throttle(throttle)
123-
.for_each(|_| counter += 1)
124-
.await;
125-
126-
assert_eq!(counter, expected);
127-
})
128-
}
129-
}

0 commit comments

Comments
 (0)