Skip to content

Commit 56c6732

Browse files
committed
fix: typo in setting min max
1 parent 48caf24 commit 56c6732

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/analysis.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl Analyser {
246246
assert_valid_decibels(min, max);
247247

248248
self.min_decibels = min;
249-
self.min_decibels = max;
249+
self.max_decibels = max;
250250
}
251251

252252
pub fn frequency_bin_count(&self) -> usize {
@@ -595,6 +595,14 @@ mod tests {
595595
}
596596
}
597597

598+
#[test]
599+
fn test_set_decibels() {
600+
let mut analyser = Analyser::new();
601+
analyser.set_decibels(-20., 10.);
602+
assert_eq!(analyser.min_decibels(), -20.);
603+
assert_eq!(analyser.max_decibels(), 10.);
604+
}
605+
598606
#[test]
599607
#[should_panic]
600608
fn test_fft_size_constraints_power_of_two() {

0 commit comments

Comments
 (0)