diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-07-20 15:22:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-20 15:22:49 -0700 |
commit | 58839cefb50e56ae5b157b37e9814ae83ceee70b (patch) | |
tree | 5de966481678096fc9567f74f96673b34a65127c /vendor/golang.org/x/text/internal/export/idna/idna_test.go | |
parent | e2f4492eadb5d3c58606b1fdd5774b63a07c236a (diff) | |
download | chat-58839cefb50e56ae5b157b37e9814ae83ceee70b.tar.gz chat-58839cefb50e56ae5b157b37e9814ae83ceee70b.tar.bz2 chat-58839cefb50e56ae5b157b37e9814ae83ceee70b.zip |
Upgrading server dependancies (#6984)
Diffstat (limited to 'vendor/golang.org/x/text/internal/export/idna/idna_test.go')
-rw-r--r-- | vendor/golang.org/x/text/internal/export/idna/idna_test.go | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/vendor/golang.org/x/text/internal/export/idna/idna_test.go b/vendor/golang.org/x/text/internal/export/idna/idna_test.go index 01fd50b7f..82ead035a 100644 --- a/vendor/golang.org/x/text/internal/export/idna/idna_test.go +++ b/vendor/golang.org/x/text/internal/export/idna/idna_test.go @@ -117,7 +117,7 @@ func TestLabelErrors(t *testing.T) { f func(string) (string, error) } punyA := kind{"PunycodeA", punycode.ToASCII} - resolve := kind{"ToASCII", Lookup.ToASCII} + resolve := kind{"ResolveA", Lookup.ToASCII} display := kind{"ToUnicode", Display.ToUnicode} p := New(VerifyDNSLength(true), MapForLookup(), BidiRule()) lengthU := kind{"CheckLengthU", p.ToUnicode} @@ -145,16 +145,25 @@ func TestLabelErrors(t *testing.T) { {display, "foo.xn--.bar", "foo..bar", ""}, {lengthA, "a..b", "a..b", "A4"}, - // Stripping leading empty labels here but not for "empty" punycode - // above seems inconsistent, but seems to be applied by both the - // conformance test and Chrome. Different interpretations would be - // possible, though. + {punyA, ".b", ".b", ""}, + // For backwards compatibility, the Punycode profile does not map runes. + {punyA, "\u3002b", "xn--b-83t", ""}, + {punyA, "..b", "..b", ""}, + // Only strip leading empty labels for certain profiles. Stripping + // leading empty labels here but not for "empty" punycode above seems + // inconsistent, but seems to be applied by both the conformance test + // and Chrome. So we turn it off by default, support it as an option, + // and enable it in profiles where it seems commonplace. + {lengthA, ".b", "b", ""}, + {lengthA, "\u3002b", "b", ""}, {lengthA, "..b", "b", ""}, - {lengthA, "b..", "b..", ""}, // TODO: remove trailing dots? + {lengthA, "b..", "b..", ""}, {resolve, "a..b", "a..b", ""}, + {resolve, ".b", "b", ""}, + {resolve, "\u3002b", "b", ""}, {resolve, "..b", "b", ""}, - {resolve, "b..", "b..", ""}, // TODO: remove trailing dots? + {resolve, "b..", "b..", ""}, // Raw punycode {punyA, "", "", ""}, |