mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
add MustNormalize (#3385)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
committed by
Miek Gieben
parent
5f114d38ca
commit
6f375cbbda
@@ -83,6 +83,17 @@ func TestHostNormalize(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestHostMustNormalizeFail(t *testing.T) {
|
||||
hosts := []string{"..:53", "::", ""}
|
||||
for i := 0; i < len(hosts); i++ {
|
||||
ts := hosts[i]
|
||||
h, err := Host(ts).MustNormalize()
|
||||
if err == nil {
|
||||
t.Errorf("Expected error, got %v", h)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestSplitHostPortReverse(t *testing.T) {
|
||||
tests := map[string]int{
|
||||
"example.org.": 0,
|
||||
|
||||
Reference in New Issue
Block a user