Add parse test for DS record

This commit is contained in:
Miek Gieben 2013-01-16 11:48:43 +01:00
parent 4ba5ac6863
commit 03c7b54668
1 changed files with 22 additions and 0 deletions

View File

@ -274,6 +274,28 @@ func TestParseLOC(t *testing.T) {
}
}
func TestParseDS(t *testing.T) {
dt := map[string]string{
"example.net. 3600 IN DS 40692 12 3 22261A8B0E0D799183E35E24E2AD6BB58533CBA7E3B14D659E9CA09B 2071398F":
"example.net.\t3600\tIN\tDS\t40692 12 3 22261A8B0E0D799183E35E24E2AD6BB58533CBA7E3B14D659E9CA09B2071398F",
}
for i, o := range dt {
rr, e := NewRR(i)
if e != nil {
t.Log("Failed to parse RR: " + e.Error())
t.Fail()
continue
}
if rr.String() != o {
t.Logf("`%s' should be equal to\n`%s', but is `%s'\n", i, o, rr.String())
t.Fail()
} else {
t.Logf("RR is OK: `%s'", rr.String())
}
}
}
func TestQuotes(t *testing.T) {
tests := map[string]string{
`t.example.com. IN TXT "a bc"`: "t.example.com.\t3600\tIN\tTXT\t\"a bc\"",