mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
committed by
Tom Limoncelli
parent
b614501d56
commit
e7472f76f3
@@ -68,3 +68,23 @@ func TestRR(t *testing.T) {
|
||||
t.Errorf("RR expected (%#v) got (%#v)\n", expected, found)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDowncase(t *testing.T) {
|
||||
dc := DomainConfig{Records: Records{
|
||||
&RecordConfig{Type: "MX", Name: "lower", Target: "targetmx"},
|
||||
&RecordConfig{Type: "MX", Name: "UPPER", Target: "TARGETMX"},
|
||||
}}
|
||||
Downcase(dc.Records)
|
||||
if !dc.HasRecordTypeName("MX", "lower") {
|
||||
t.Errorf("%v: expected (%v) got (%v)\n", dc.Records, false, true)
|
||||
}
|
||||
if !dc.HasRecordTypeName("MX", "upper") {
|
||||
t.Errorf("%v: expected (%v) got (%v)\n", dc.Records, false, true)
|
||||
}
|
||||
if dc.Records[0].Target != "targetmx" {
|
||||
t.Errorf("%v: target0 expected (%v) got (%v)\n", dc.Records, "targetmx", dc.Records[0].Target)
|
||||
}
|
||||
if dc.Records[1].Target != "targetmx" {
|
||||
t.Errorf("%v: target1 expected (%v) got (%v)\n", dc.Records, "targetmx", dc.Records[1].Target)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user