Skip to content

Commit

Permalink
handler: imp tests
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Dec 27, 2024
1 parent ef2dd46 commit f80639a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions internal/handler/default_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ func TestDefault_resolveFromHosts(t *testing.T) {
})

const (
domainV4 = "ipv4.domain.example."
domainV6 = "ipv6.domain.example."
fqdnV4 = "ipv4.domain.example."
fqdnV6 = "ipv6.domain.example."
)

var (
Expand All @@ -118,26 +118,26 @@ func TestDefault_resolveFromHosts(t *testing.T) {
}{{
wantAns: &dns.A{
Hdr: dns.RR_Header{
Name: domainV4,
Name: fqdnV4,
Rrtype: dns.TypeA,
Class: dns.ClassINET,
Ttl: 10,
},
A: addrV4.AsSlice(),
},
req: (&dns.Msg{}).SetQuestion(domainV4, dns.TypeA),
req: (&dns.Msg{}).SetQuestion(fqdnV4, dns.TypeA),
name: "success_a",
}, {
wantAns: &dns.AAAA{
Hdr: dns.RR_Header{
Name: domainV6,
Name: fqdnV6,
Rrtype: dns.TypeAAAA,
Class: dns.ClassINET,
Ttl: 10,
},
AAAA: addrV6.AsSlice(),
},
req: (&dns.Msg{}).SetQuestion(domainV6, dns.TypeAAAA),
req: (&dns.Msg{}).SetQuestion(fqdnV6, dns.TypeAAAA),
name: "success_aaaa",
}, {
wantAns: &dns.PTR{
Expand All @@ -147,7 +147,7 @@ func TestDefault_resolveFromHosts(t *testing.T) {
Class: dns.ClassINET,
Ttl: 10,
},
Ptr: domainV4,
Ptr: fqdnV4,
},
req: (&dns.Msg{}).SetQuestion(reversedV4, dns.TypePTR),
name: "success_ptr_v4",
Expand All @@ -159,7 +159,7 @@ func TestDefault_resolveFromHosts(t *testing.T) {
Class: dns.ClassINET,
Ttl: 10,
},
Ptr: domainV6,
Ptr: fqdnV6,
},
req: (&dns.Msg{}).SetQuestion(reversedV6, dns.TypePTR),
name: "success_ptr_v6",
Expand Down

0 comments on commit f80639a

Please sign in to comment.