Update test and gofmt

This commit is contained in:
Miek Gieben 2014-11-09 16:09:49 +00:00
parent 7619917e11
commit d33af8db79
5 changed files with 21 additions and 18 deletions

View File

@ -68,7 +68,7 @@ func TestServing(t *testing.T) {
m := new(Msg)
m.SetQuestion("miek.nl.", TypeTXT)
r, _, err := c.Exchange(m, addrstr)
if err != nil {
if err != nil || len(r.Extra) == 0 {
t.Log("failed to exchange miek.nl", err)
t.Fatal()
}

View File

@ -23,11 +23,14 @@ func TestDynamicUpdateParsing(t *testing.T) {
func TestDynamicUpdateUnpack(t *testing.T) {
// From https://github.com/miekg/dns/issues/150#issuecomment-62296803
// It should be an update message for the zone "example.",
// deleting the A RRset "example." and then adding an A record at "example.".
// class ANY, TYPE A
buf := []byte{171, 68, 40, 0, 0, 1, 0, 0, 0, 2, 0, 0, 7, 101, 120, 97, 109, 112, 108, 101, 0, 0, 6, 0, 1, 192, 12, 0, 1, 0, 255, 0, 0, 0, 0, 0, 0, 192, 12, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 127, 0, 0, 1}
msg := new(Msg)
err := msg.Unpack(buf)
if err != nil {
t.Log("failed to unpack: " + err.Error())
// t.Fail()
t.Log("failed to unpack: " + err.Error() + "\n" + msg.String()))
t.Fail()
}
}