Skip to content

Commit 7af57e6

Browse files
committed
test that missing items are probably missing
1 parent c5d9f20 commit 7af57e6

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

test/test.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,20 @@ describe('JSBloom - Bloom Filter', function() {
6363

6464
});
6565

66+
describe('Non-Existence', function() {
67+
it('should return false for 1000 non elements', function() {
68+
var positive = 0;
69+
for (var i = 1000 - 1; i >= 0; i--) {
70+
if(filter.checkEntry(generator()))
71+
positive ++;
72+
};
73+
assert.ok(positive <= 10, 'should have had less than 10 positive tests, but had:'+positive);
74+
});
75+
76+
});
77+
78+
79+
6680
describe('Import & Export', function() {
6781
it('should return true on predefined element in imported array', function() {
6882
filter.importData(importData);
@@ -87,4 +101,10 @@ describe('JSBloom - Bloom Filter', function() {
87101

88102
});
89103

90-
});
104+
});
105+
106+
107+
108+
109+
110+

0 commit comments

Comments
 (0)