Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
matheus23 committed Aug 18, 2023
1 parent e0e7548 commit 96ef951
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions deterministic-bloom/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,17 @@ impl BloomParams {
}
}

#[cfg(test)]
mod tests {
use super::HashIndexIterator;

#[test]
fn test_zero_bit_size() {
let mut iterator = HashIndexIterator::new(&[1, 2, 3], 0);
assert_eq!(iterator.next(), None);
}
}

#[cfg(test)]
mod proptests {
use super::BloomParams;
Expand Down
2 changes: 1 addition & 1 deletion deterministic-bloom/src/runtime_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,6 @@ mod proptests {

let computed_fpr = false_positives as f64 / measurements as f64;
// The actual FPR should be pretty close
prop_assert!((computed_fpr - fpr).abs() < 1e-3);
prop_assert!((computed_fpr - fpr).abs() < 1.5e-3);
}
}

0 comments on commit 96ef951

Please sign in to comment.