Add test for upcoming txt changes
This commit is contained in:
parent
6f477021c0
commit
2ea84f6110
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue