Use known keys in the unit test to avoid random false positives.

This commit is contained in:
Anatoly Yakovenko
2018-11-17 20:48:32 -08:00
committed by Greg Fitzgerald
parent 3d113611cc
commit fc67a968e8

View File

@ -81,6 +81,8 @@ mod test {
#[test]
fn test_add_contains() {
let mut bloom: Bloom<Hash> = Bloom::random(100, 0.1, 100);
//known keys to avoid false positives in the test
bloom.keys = vec![0, 1, 2, 3];
let key = hash(b"hello");
assert!(!bloom.contains(&key));