Add tests for normalize.go

Fix some of the documentation in the process.
This commit is contained in:
Miek Gieben 2016-09-07 12:41:40 +00:00
parent d1f17fa7e0
commit 5216ab6b58
2 changed files with 97 additions and 2 deletions

View file

@ -16,7 +16,7 @@ func (z Zones) Matches(qname string) string {
zone := ""
for _, zname := range z {
if dns.IsSubDomain(zname, qname) {
// TODO(miek): hmm, add test for this case
// We want the *longest* matching zone, otherwise we may end up in a parent
if len(zname) > len(zone) {
zone = zname
}
@ -41,7 +41,6 @@ func (n Name) Matches(child string) bool {
if dns.Name(n) == dns.Name(child) {
return true
}
return dns.IsSubDomain(string(n), child)
}