Add Copy test

This commit is contained in:
Miek Gieben 2014-06-06 21:10:38 +01:00
parent 060e66250e
commit 5a8fe5d5f7
1 changed files with 8 additions and 0 deletions

View File

@ -479,3 +479,11 @@ func TestRdataOverflow(t *testing.T) {
t.Fatalf("Oversize rrdata pack didn't return ErrRdata - instead: %v", err)
}
}
func TestCopy(t *testing.T) {
rr, _ := NewRR("miek.nl. 2311 IN A 127.0.0.1") // Weird TTL to avoid catching TTL
rr1 := Copy(rr)
if rr.String() != rr1.String() {
t.Fatalf("Copy() failed %s != %s", rr.String(), rr1.String())
}
}