| // Copyright 2009 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| {"_xmpp-server._tcp.google.com", true}, |
| {"_xmpp-server._tcp.google.com", true}, |
| func getTestCases(ch chan<- testCase) { |
| for i := 0; i < 59; i++ { |
| for _, tc := range tests { |
| ch <- testCase{char63 + ".com", true} |
| ch <- testCase{char64 + ".com", false} |
| // 255 char name is fine: |
| ch <- testCase{char59 + "." + char63 + "." + char63 + "." + |
| ch <- testCase{char59 + "a." + char63 + "." + char63 + "." + |
| func TestDNSNames(t *testing.T) { |
| if runtime.GOOS == "windows" { |
| ch := make(chan testCase) |
| if isDomainName(tc.name) != tc.result { |
| t.Errorf("isDomainName(%v) failed: Should be %v", |