aboutsummaryrefslogtreecommitdiff
path: root/rescached_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2019-03-02 07:23:20 +0700
committerShulhan <ms@kilabit.info>2019-03-02 07:24:29 +0700
commit507652efff5d76f82e08eb09d445d486d10a4415 (patch)
tree7a0b1b6376b9e65df04a82194d1ad09343dc45d6 /rescached_test.go
parent319f7e60884456fb1850e98b770e59aa8d8e299f (diff)
downloadrescached-507652efff5d76f82e08eb09d445d486d10a4415.tar.xz
go.mod: update dependency github.com/shuLhan/share to v0.4.0
The dns package provide more human readable when printing Question. Instead of printing query type in number, for example A record with "1", the Question stringer now print "A" instead.
Diffstat (limited to 'rescached_test.go')
-rw-r--r--rescached_test.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/rescached_test.go b/rescached_test.go
index 0254384..22ab579 100644
--- a/rescached_test.go
+++ b/rescached_test.go
@@ -194,7 +194,7 @@ func TestLoadHostsDir(t *testing.T) {
}, {
desc: "With non empty directory",
dir: "testdata/hosts.d",
- expCaches: `caches\[1.test:\[{0 \d+ &{Name:1.test Type:1 Class:1}}\] 2.test:\[{0 \d+ &{Name:2.test Type:1 Class:1}}\]\]`, // nolint: lll
+ expCaches: `caches\[1.test:\[{0 \d+ &{Name:1.test Type:A}}\] 2.test:\[{0 \d+ &{Name:2.test Type:A}}\]\]`, // nolint: lll
}}
srv := New(nil)
@@ -231,7 +231,7 @@ func TestLoadMasterDir(t *testing.T) {
}, {
desc: "With non empty directory",
dir: "testdata/master.d",
- expCaches: `caches\[test.x:\[{0 \d+ &{Name:test.x Type:1 Class:1}}\]\]`, // nolint: lll
+ expCaches: `caches\[test.x:\[{0 \d+ &{Name:test.x Type:A}}\]\]`, // nolint: lll
}}
srv := New(nil)
@@ -300,6 +300,7 @@ func TestProcessRequest(t *testing.T) {
req: &dns.Request{
Kind: dns.ConnTypeUDP,
Message: &dns.Message{
+ Header: &dns.SectionHeader{},
Question: &dns.SectionQuestion{
Name: []byte("notexist"),
Type: dns.QueryTypeA,
@@ -310,6 +311,7 @@ func TestProcessRequest(t *testing.T) {
expFw: &dns.Request{
Kind: dns.ConnTypeUDP,
Message: &dns.Message{
+ Header: &dns.SectionHeader{},
Question: &dns.SectionQuestion{
Name: []byte("notexist"),
Type: dns.QueryTypeA,
@@ -322,6 +324,7 @@ func TestProcessRequest(t *testing.T) {
req: &dns.Request{
Kind: dns.ConnTypeUDP,
Message: &dns.Message{
+ Header: &dns.SectionHeader{},
Question: &dns.SectionQuestion{
Name: []byte("notexist"),
Type: dns.QueryTypeA,
@@ -334,6 +337,7 @@ func TestProcessRequest(t *testing.T) {
req: &dns.Request{
Kind: dns.ConnTypeDoH,
Message: &dns.Message{
+ Header: &dns.SectionHeader{},
Question: &dns.SectionQuestion{
Name: []byte("doh"),
Type: dns.QueryTypeA,
@@ -344,6 +348,7 @@ func TestProcessRequest(t *testing.T) {
expFwDoH: &dns.Request{
Kind: dns.ConnTypeDoH,
Message: &dns.Message{
+ Header: &dns.SectionHeader{},
Question: &dns.SectionQuestion{
Name: []byte("doh"),
Type: dns.QueryTypeA,