Skip to content

Commit

Permalink
Move tests and start update_test.go
Browse files Browse the repository at this point in the history
Put the update tests in a seperate file.
  • Loading branch information
miekg committed Nov 9, 2014
1 parent eff0e93 commit a8bb44f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion client_test.go
Expand Up @@ -165,7 +165,7 @@ func TestClientAXFRMultipleEnvelopes(t *testing.T) {
}
*/

// ExapleUpdateLeaseTSIG shows how to update a lease signed with TSIG.
// ExampleUpdateLeaseTSIG shows how to update a lease signed with TSIG.
func ExampleUpdateLeaseTSIG(t *testing.T) {
m := new(Msg)
m.SetUpdate("t.local.ip6.io.")
Expand Down
17 changes: 0 additions & 17 deletions parse_test.go
Expand Up @@ -1225,23 +1225,6 @@ func TestMalformedPackets(t *testing.T) {
}
}

func TestDynamicUpdateParsing(t *testing.T) {
prefix := "example.com. IN "
for _, typ := range TypeToString {
if typ == "CAA" || typ == "OPT" || typ == "AXFR" || typ == "IXFR" || typ == "ANY" || typ == "TKEY" ||
typ == "TSIG" || typ == "ISDN" || typ == "UNSPEC" || typ == "NULL" || typ == "ATMA" {
continue
}
r, e := NewRR(prefix + typ)
if e != nil {
t.Log("failure to parse: " + prefix + typ)
t.Fail()
} else {
t.Logf("parsed: %s", r.String())
}
}
}

type algorithm struct {
name uint8
bits int
Expand Down
19 changes: 19 additions & 0 deletions update_test.go
@@ -0,0 +1,19 @@
package dns

func TestDynamicUpdateParsing(t *testing.T) {
prefix := "example.com. IN "
for _, typ := range TypeToString {
if typ == "CAA" || typ == "OPT" || typ == "AXFR" || typ == "IXFR" || typ == "ANY" || typ == "TKEY" ||
typ == "TSIG" || typ == "ISDN" || typ == "UNSPEC" || typ == "NULL" || typ == "ATMA" {
continue
}
r, e := NewRR(prefix + typ)
if e != nil {
t.Log("failure to parse: " + prefix + typ)
t.Fail()
} else {
t.Logf("parsed: %s", r.String())
}
}
}

0 comments on commit a8bb44f

Please sign in to comment.