aboutsummaryrefslogtreecommitdiffstats
path: root/core/types/bloom9_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/types/bloom9_test.go')
-rw-r--r--core/types/bloom9_test.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/core/types/bloom9_test.go b/core/types/bloom9_test.go
index f020670b1..5744bec6c 100644
--- a/core/types/bloom9_test.go
+++ b/core/types/bloom9_test.go
@@ -16,6 +16,40 @@
package types
+import (
+ "math/big"
+ "testing"
+)
+
+func TestBloom(t *testing.T) {
+ positive := []string{
+ "testtest",
+ "test",
+ "hallo",
+ "other",
+ }
+ negative := []string{
+ "tes",
+ "lo",
+ }
+
+ var bloom Bloom
+ for _, data := range positive {
+ bloom.Add(new(big.Int).SetBytes([]byte(data)))
+ }
+
+ for _, data := range positive {
+ if !bloom.Test(new(big.Int).SetBytes([]byte(data))) {
+ t.Error("expected", data, "to test true")
+ }
+ }
+ for _, data := range negative {
+ if bloom.Test(new(big.Int).SetBytes([]byte(data))) {
+ t.Error("did not expect", data, "to test true")
+ }
+ }
+}
+
/*
import (
"testing"