mirror of
https://github.com/status-im/fathom.git
synced 2025-03-01 03:20:27 +00:00
26 lines
401 B
Go
26 lines
401 B
Go
package aggregator
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestBlacklistHas(t *testing.T) {
|
|
b, err := newBlacklist()
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
|
|
table := map[string]bool{
|
|
"03e.info": true,
|
|
"zvetki.ru": true,
|
|
"usefathom.com": false,
|
|
"foo.03e.info": true, // sub-string match
|
|
}
|
|
|
|
for r, e := range table {
|
|
if v := b.Has(r); v != e {
|
|
t.Errorf("Expected %v, got %v", e, v)
|
|
}
|
|
}
|
|
}
|