mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 00:22:41 +08:00
21 lines
302 B
Go
21 lines
302 B
Go
package bloom_test
|
|
|
|
import (
|
|
"fmt"
|
|
"strconv"
|
|
"testing"
|
|
|
|
"github.com/charlienet/go-mixed/bloom"
|
|
)
|
|
|
|
func TestBloom(t *testing.T) {
|
|
b := bloom.NewBloomFilter()
|
|
|
|
for i := 0; i < 1000000; i++ {
|
|
b.Add(strconv.Itoa(i))
|
|
}
|
|
|
|
fmt.Println(b.Contains(strconv.Itoa(9999)))
|
|
fmt.Println(b.Contains("ss"))
|
|
}
|