aboutsummaryrefslogtreecommitdiff
path: root/plugin/normalize_test.go
diff options
context:
space:
mode:
authorGravatar Chris O'Haver <cohaver@infoblox.com> 2019-10-19 03:08:14 -0400
committerGravatar Miek Gieben <miek@miek.nl> 2019-10-19 08:08:14 +0100
commit6f375cbbda9cd8572d8f7b271138045282ede7b5 (patch)
treea454fdbdd5d6aaf901c82e76a79b04dcee1a69d7 /plugin/normalize_test.go
parent5f114d38cab74f0c5c99b03ffe99f5607e393a92 (diff)
downloadcoredns-6f375cbbda9cd8572d8f7b271138045282ede7b5.tar.gz
coredns-6f375cbbda9cd8572d8f7b271138045282ede7b5.tar.zst
coredns-6f375cbbda9cd8572d8f7b271138045282ede7b5.zip
add MustNormalize (#3385)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
Diffstat (limited to 'plugin/normalize_test.go')
-rw-r--r--plugin/normalize_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugin/normalize_test.go b/plugin/normalize_test.go
index 315aaf5d9..2a82271ba 100644
--- a/plugin/normalize_test.go
+++ b/plugin/normalize_test.go
@@ -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,