From 0a1d7fd70732c306f39c777cbe60bb8bf1ab9da5 Mon Sep 17 00:00:00 2001 From: Simon Zolin Date: Tue, 9 Jul 2019 11:35:39 +0300 Subject: [PATCH] - fix tests --- dnsfilter/dnsfilter_test.go | 2 +- dnsforward/dnsforward_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dnsfilter/dnsfilter_test.go b/dnsfilter/dnsfilter_test.go index 84a4b452..75b5cb47 100644 --- a/dnsfilter/dnsfilter_test.go +++ b/dnsfilter/dnsfilter_test.go @@ -561,7 +561,7 @@ func BenchmarkSafeSearchParallel(b *testing.B) { func TestDnsfilterDialCache(t *testing.T) { 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") if searchInDialCache("hostname") != "" { diff --git a/dnsforward/dnsforward_test.go b/dnsforward/dnsforward_test.go index b0fbcae8..6b685510 100644 --- a/dnsforward/dnsforward_test.go +++ b/dnsforward/dnsforward_test.go @@ -459,7 +459,7 @@ func createTestServer(t *testing.T) *Server { s.conf.Filters = make([]dnsfilter.Filter, 0) 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) return s }