- fix tests
This commit is contained in:
parent
26db906e54
commit
0a1d7fd707
|
@ -561,7 +561,7 @@ func BenchmarkSafeSearchParallel(b *testing.B) {
|
||||||
|
|
||||||
func TestDnsfilterDialCache(t *testing.T) {
|
func TestDnsfilterDialCache(t *testing.T) {
|
||||||
d := Dnsfilter{}
|
d := Dnsfilter{}
|
||||||
dialCache = gcache.New(1).LRU().Expiration(30 * time.Minute).Build()
|
gctx.dialCache = gcache.New(1).LRU().Expiration(30 * time.Minute).Build()
|
||||||
|
|
||||||
d.shouldBeInDialCache("hostname")
|
d.shouldBeInDialCache("hostname")
|
||||||
if searchInDialCache("hostname") != "" {
|
if searchInDialCache("hostname") != "" {
|
||||||
|
|
|
@ -459,7 +459,7 @@ func createTestServer(t *testing.T) *Server {
|
||||||
s.conf.Filters = make([]dnsfilter.Filter, 0)
|
s.conf.Filters = make([]dnsfilter.Filter, 0)
|
||||||
|
|
||||||
rules := "||nxdomain.example.org^\n||null.example.org^\n127.0.0.1 host.example.org\n"
|
rules := "||nxdomain.example.org^\n||null.example.org^\n127.0.0.1 host.example.org\n"
|
||||||
filter := dnsfilter.Filter{ID: 1, Data: []byte(rules)}
|
filter := dnsfilter.Filter{ID: 0, Data: []byte(rules)}
|
||||||
s.conf.Filters = append(s.conf.Filters, filter)
|
s.conf.Filters = append(s.conf.Filters, filter)
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue