Add test for upcoming txt changes

This commit is contained in:
Miek Gieben 2014-03-01 07:34:44 +00:00
parent 6f477021c0
commit 2ea84f6110
1 changed files with 15 additions and 0 deletions

View File

@ -890,3 +890,18 @@ func TestTxtEqual(t *testing.T) {
t.Logf("\n%s\n%s\n", rr1.String(), rr2.String())
}
}
func TestTxtLong(t *testing.T) {
rr1 := new(TXT)
rr1.Hdr = RR_Header{Name: ".", Rrtype: TypeTXT, Class: ClassINET, Ttl: 0}
// Make a long txt record, this breaks when sending the packet,
// but not earlier.
rr1.Txt = []string{"start-"}
for i := 0; i < 200; i++ {
rr1.Txt[0] += "start-"
}
str := rr1.String()
if len(str) < len(rr1.Txt[0]) {
t.Logf("String conversion should just work")
t.Fail()
}
}