empty non-terminal support

When looking for a name in tree, return wether we got to a longer one -

if so we had an ent. Add tests + dnssec tests and refactor the tests as

well a bit.
This commit is contained in:
Miek Gieben
2016-04-02 16:56:16 +01:00
parent d8ab95cd18
commit 9b21646954
13 changed files with 423 additions and 267 deletions

View File

@@ -1,30 +1,3 @@
package file
import (
"testing"
"github.com/miekg/dns"
)
func TestZoneInsert(t *testing.T) {
z := NewZone("miek.nl")
rr, _ := dns.NewRR("miek.nl. IN A 127.0.0.1")
z.Insert(rr)
t.Logf("%+v\n", z)
elem := z.Get(rr)
t.Logf("%+v\n", elem)
if elem != nil {
t.Logf("%+v\n", elem.Types(dns.TypeA))
}
z.Delete(rr)
t.Logf("%+v\n", z)
elem = z.Get(rr)
t.Logf("%+v\n", elem)
if elem != nil {
t.Logf("%+v\n", elem.Types(dns.TypeA))
}
}
// TODO tests here.