File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -74,13 +74,6 @@ func TestBloomFilter_Add(t *testing.T) {
7474 })
7575
7676 t .Run ("add should panic when number of entries exceed the capacity" , func (t * testing.T ) {
77- defer func () {
78- if r := recover (); r == nil {
79- fmt .Println ("recovered from panic" )
80- return
81- }
82- }()
83-
8477 count := 1000
8578 opts := & BloomOptions {
8679 Err_rate : 0.01 ,
@@ -98,8 +91,10 @@ func TestBloomFilter_Add(t *testing.T) {
9891 binary .LittleEndian .PutUint32 (by [:], uint32 (i ))
9992 bf .Add (by [:])
10093 }
101- bf .Add ([]byte ("test" ))
102- t .Errorf ("Expected function to panic when number of entries exceed the capacity" )
94+ err := bf .Add ([]byte ("test" ))
95+ if err == nil {
96+ t .Errorf ("Expected error, got nil" )
97+ }
10398 })
10499
105100 t .Run ("get should panic when there is no persistent store" , func (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments