From 6f375cbbda9cd8572d8f7b271138045282ede7b5 Mon Sep 17 00:00:00 2001 From: Chris O'Haver Date: Sat, 19 Oct 2019 03:08:14 -0400 Subject: add MustNormalize (#3385) Signed-off-by: Chris O'Haver --- plugin/normalize_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'plugin/normalize_test.go') 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, -- cgit v1.2.3