* Fix error comparison in SetTA * Add testcase TestParseTA()
This commit is contained in:
parent
833bf76c28
commit
501e858f67
|
@ -1665,9 +1665,9 @@ func setTA(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) {
|
|||
return nil, &ParseError{f, "bad TA DigestType", l}, ""
|
||||
}
|
||||
rr.DigestType = uint8(i)
|
||||
s, e, c1 := endingToString(c, "bad TA Digest", f)
|
||||
if e != nil {
|
||||
return nil, e.(*ParseError), c1
|
||||
s, err, c1 := endingToString(c, "bad TA Digest", f)
|
||||
if err != nil {
|
||||
return nil, err, c1
|
||||
}
|
||||
rr.Digest = s
|
||||
return rr, nil, c1
|
||||
|
|
10
scan_test.go
10
scan_test.go
|
@ -79,3 +79,13 @@ func TestParseZoneInclude(t *testing.T) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseTA(t *testing.T) {
|
||||
rr, err := NewRR(` Ta 0 0 0`)
|
||||
if err != nil {
|
||||
t.Fatalf("expected no error, but got %s", err)
|
||||
}
|
||||
if rr == nil {
|
||||
t.Fatal(`expected a normal RR, but got nil`)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue