Initial commit
This commit is contained in:
commit
2d98ed1b5d
33 changed files with 4644 additions and 0 deletions
20
checker/types_test.go
Normal file
20
checker/types_test.go
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
package checker
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestRRsetKey(t *testing.T) {
|
||||
cases := []struct {
|
||||
name, typ, want string
|
||||
}{
|
||||
{"example.com", "A", "example.com./A"},
|
||||
{"example.com.", "A", "example.com./A"},
|
||||
{"WWW.Example.Com", "AAAA", "WWW.Example.Com./AAAA"}, // case is preserved (Fqdn doesn't downcase)
|
||||
{".", "SOA", "./SOA"},
|
||||
{"sub.example.com", "MX", "sub.example.com./MX"},
|
||||
}
|
||||
for _, c := range cases {
|
||||
if got := rrsetKey(c.name, c.typ); got != c.want {
|
||||
t.Errorf("rrsetKey(%q,%q) = %q, want %q", c.name, c.typ, got, c.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue