Move tests and start update_test.go

Put the update tests in a seperate file.
This commit is contained in:
Miek Gieben 2014-11-09 09:56:22 +00:00
parent eff0e9354f
commit a8bb44f5e5
3 changed files with 20 additions and 18 deletions

View File

@ -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.")

View File

@ -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

19
update_test.go Normal file
View File

@ -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())
}
}
}