Skip to content

Commit b28c09b

Browse files
committed
adds test for reverb
1 parent 5cddaf8 commit b28c09b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/reverb.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
mod test_support;
2+
use std::time::Duration;
3+
4+
use rodio::Source;
5+
use test_support::{TestSource, TestSpan};
6+
7+
#[test]
8+
fn without_buffered() {
9+
let source = TestSource::new()
10+
.with_span(TestSpan::silence().with_exact_duration(Duration::from_secs(5)));
11+
12+
let reverb = source.clone().reverb(Duration::from_secs_f32(0.05), 0.3);
13+
let n_samples = reverb.count();
14+
15+
assert_eq!(n_samples, source.len(),);
16+
}
17+
18+
#[test]
19+
fn with_buffered() {
20+
let source = TestSource::new()
21+
.with_span(TestSpan::silence().with_exact_duration(Duration::from_secs(5)));
22+
23+
let reverb = source.clone().buffered().reverb(Duration::from_secs_f32(0.05), 0.3);
24+
let n_samples = reverb.count();
25+
26+
assert_eq!(n_samples, source.len(),);
27+
}

0 commit comments

Comments
 (0)