From 98d0d15ddcd90086037b85c5e8dac8ebd0d7247d Mon Sep 17 00:00:00 2001 From: James Bardin Date: Mon, 20 Nov 2017 16:11:39 -0500 Subject: [PATCH] Update the FriendlyHost tests for svchost.Hostname This no longer allows normalization of punycode hostnames. This shouldn't be a problem, as they were not valid in the first place. --- registry/regsrc/friendly_host_test.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/registry/regsrc/friendly_host_test.go b/registry/regsrc/friendly_host_test.go index e87774cfe9..53cec8f841 100644 --- a/registry/regsrc/friendly_host_test.go +++ b/registry/regsrc/friendly_host_test.go @@ -59,7 +59,7 @@ func TestFriendlyHost(t *testing.T) { source: "xn--s-fka0wmm0zea7g8b.xn--o-8ta85a3b1dwcda1k.io", wantHost: "xn--s-fka0wmm0zea7g8b.xn--o-8ta85a3b1dwcda1k.io", wantDisplay: "ʎɹʇsıƃǝɹ.ɯɹoɟɐɹɹǝʇ.io", - wantNorm: "xn--s-fka0wmm0zea7g8b.xn--o-8ta85a3b1dwcda1k.io", + wantNorm: InvalidHostString, wantValid: false, }, { @@ -109,13 +109,9 @@ func TestFriendlyHost(t *testing.T) { } // Also verify that host compares equal with all the variants. - if !gotHost.Equal(&FriendlyHost{Raw: tt.wantDisplay}) { - t.Fatalf("Equal() should be true for %s and %s", tt.wantHost, tt.wantValid) - } - if !gotHost.Equal(&FriendlyHost{Raw: tt.wantNorm}) { - t.Fatalf("Equal() should be true for %s and %s", tt.wantHost, tt.wantNorm) + if gotHost.Valid() && !gotHost.Equal(&FriendlyHost{Raw: tt.wantDisplay}) { + t.Fatalf("Equal() should be true for %s and %s", tt.wantHost, tt.wantDisplay) } - }) } }