publicsuffix: regenerate table · golang/net@1f1fa29 (original) (raw)

`@@ -63,12 +63,11 @@ func TestFind(t *testing.T) {

`

63

63

``

64

64

`func TestICANN(t *testing.T) {

`

65

65

`testCases := map[string]bool{

`

66

``

`-

"foo.org": true,

`

67

``

`-

"foo.co.uk": true,

`

68

``

`-

"foo.dyndns.org": false,

`

69

``

`-

"foo.go.dyndns.org": false,

`

70

``

`-

"foo.blogspot.co.uk": false,

`

71

``

`-

"foo.intranet": false,

`

``

66

`+

"foo.org": true,

`

``

67

`+

"foo.co.uk": true,

`

``

68

`+

"foo.dyndns.org": false,

`

``

69

`+

"foo.go.dyndns.org": false,

`

``

70

`+

"foo.intranet": false,

`

72

71

` }

`

73

72

`for domain, want := range testCases {

`

74

73

`_, got := PublicSuffix(domain)

`

`@@ -111,16 +110,12 @@ var publicSuffixTestCases = []struct {

`

111

110

`// net.ar

`

112

111

`// org.ar

`

113

112

`// tur.ar

`

114

``

`-

// blogspot.com.ar (in the PRIVATE DOMAIN section).

`

115

113

` {"ar", "ar", true},

`

116

114

` {"www.ar", "ar", true},

`

117

115

` {"nic.ar", "ar", true},

`

118

116

` {"www.nic.ar", "ar", true},

`

119

117

` {"com.ar", "com.ar", true},

`

120

118

` {"www.com.ar", "com.ar", true},

`

121

``

`-

{"blogspot.com.ar", "blogspot.com.ar", false}, // PRIVATE DOMAIN.

`

122

``

`-

{"www.blogspot.com.ar", "blogspot.com.ar", false}, // PRIVATE DOMAIN.

`

123

``

`-

{"www.xxx.yyy.zzz.blogspot.com.ar", "blogspot.com.ar", false}, // PRIVATE DOMAIN.

`

124

119

` {"logspot.com.ar", "com.ar", true},

`

125

120

` {"zlogspot.com.ar", "com.ar", true},

`

126

121

` {"zblogspot.com.ar", "com.ar", true},

`

`@@ -170,20 +165,13 @@ var publicSuffixTestCases = []struct {

`

170

165

`// game.tw

`

171

166

`// ebiz.tw

`

172

167

`// club.tw

`

173

``

`-

// 網路.tw (xn--zf0ao64a.tw)

`

174

``

`-

// 組織.tw (xn--uc0atv.tw)

`

175

``

`-

// 商業.tw (xn--czrw28b.tw)

`

176

``

`-

// blogspot.tw

`

``

168

`+

// 台灣.tw (xn--kpry57d.tw)

`

177

169

` {"tw", "tw", true},

`

178

170

` {"aaa.tw", "tw", true},

`

179

171

` {"www.aaa.tw", "tw", true},

`

180

172

` {"xn--czrw28b.aaa.tw", "tw", true},

`

181

173

` {"edu.tw", "edu.tw", true},

`

182

174

` {"www.edu.tw", "edu.tw", true},

`

183

``

`-

{"xn--czrw28b.edu.tw", "edu.tw", true},

`

184

``

`-

{"xn--czrw28b.tw", "xn--czrw28b.tw", true},

`

185

``

`-

{"www.xn--czrw28b.tw", "xn--czrw28b.tw", true},

`

186

``

`-

{"xn--uc0atv.xn--czrw28b.tw", "xn--czrw28b.tw", true},

`

187

175

` {"xn--kpry57d.tw", "tw", true},

`

188

176

``

189

177

`// The .uk rules are:

`

`@@ -199,7 +187,6 @@ var publicSuffixTestCases = []struct {

`

199

187

`// plc.uk

`

200

188

`// police.uk

`

201

189

`// *.sch.uk

`

202

``

`-

// blogspot.co.uk (in the PRIVATE DOMAIN section).

`

203

190

` {"uk", "uk", true},

`

204

191

` {"aaa.uk", "uk", true},

`

205

192

` {"www.aaa.uk", "uk", true},

`

`@@ -210,9 +197,6 @@ var publicSuffixTestCases = []struct {

`

210

197

` {"www.sch.uk", "www.sch.uk", true},

`

211

198

` {"co.uk", "co.uk", true},

`

212

199

` {"www.co.uk", "co.uk", true},

`

213

``

`-

{"blogspot.co.uk", "blogspot.co.uk", false}, // PRIVATE DOMAIN.

`

214

``

`-

{"blogspot.nic.uk", "uk", true},

`

215

``

`-

{"blogspot.sch.uk", "blogspot.sch.uk", true},

`

216

200

``

217

201

`// The .рф rules are

`

218

202

`// рф (xn--p1ai)

`

`@@ -322,10 +306,10 @@ func TestNumICANNRules(t *testing.T) {

`

322

306

`// Check the last ICANN and first Private rules. If the underlying public

`

323

307

`// suffix list changes, we may need to update these hard-coded checks.

`

324

308

`if got, want := rules[numICANNRules-1], "zuerich"; got != want {

`

325

``

`-

t.Errorf("last ICANN rule: got %q, wawnt %q", got, want)

`

``

309

`+

t.Errorf("last ICANN rule: got %q, want %q", got, want)

`

326

310

` }

`

327

``

`-

if got, want := rules[numICANNRules], "cc.ua"; got != want {

`

328

``

`-

t.Errorf("first Private rule: got %q, wawnt %q", got, want)

`

``

311

`+

if got, want := rules[numICANNRules], "co.krd"; got != want {

`

``

312

`+

t.Errorf("first Private rule: got %q, want %q", got, want)

`

329

313

` }

`

330

314

`}

`

331

315

``