Use known keys in the unit test to avoid random false positives.
This commit is contained in:
committed by
Greg Fitzgerald
parent
3d113611cc
commit
fc67a968e8
@ -81,6 +81,8 @@ mod test {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_add_contains() {
|
fn test_add_contains() {
|
||||||
let mut bloom: Bloom<Hash> = Bloom::random(100, 0.1, 100);
|
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");
|
let key = hash(b"hello");
|
||||||
assert!(!bloom.contains(&key));
|
assert!(!bloom.contains(&key));
|
||||||
|
Reference in New Issue
Block a user