-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsplithostport_test.go
More file actions
547 lines (474 loc) · 18.8 KB
/
Copy pathsplithostport_test.go
File metadata and controls
547 lines (474 loc) · 18.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
package core
import (
"net"
"net/netip"
"testing"
)
// Compile-time verification that test case types implement TestCase interface
var _ TestCase = splitAddrPortCase{}
var _ TestCase = splitHostPortCase{}
var _ TestCase = makeHostPortCase{}
var _ TestCase = joinHostPortCase{}
var _ TestCase = doMakeHostPortCase{}
var _ TestCase = doJoinHostPortCase{}
var _ TestCase = ipForHostPortCase{}
var _ TestCase = addrErrCase{}
type splitAddrPortCase struct {
name string
addrPort string
addr string
port uint16
ok bool
}
func (tc splitAddrPortCase) Name() string {
return tc.name
}
func (tc splitAddrPortCase) matches(a netip.Addr, p uint16, err error) bool {
if err != nil {
return !tc.ok && !a.IsValid() && p == 0
}
return tc.ok && a.String() == tc.addr && p == tc.port
}
func (tc splitAddrPortCase) Test(t *testing.T) {
t.Helper()
a, p, err := SplitAddrPort(tc.addrPort)
if !tc.matches(a, p, err) {
// unexpected result
t.Errorf("SplitAddrPort(%q) -> %q, %q, %#v", tc.addrPort, a.String(), p, err)
} else {
// expected result
t.Logf("SplitAddrPort(%q) -> %q, %q, %#v", tc.addrPort, a.String(), p, err)
}
}
func newSplitAddrPortCase(name, addrPort, addr string, port uint16, ok bool) splitAddrPortCase {
return splitAddrPortCase{
name: name,
addrPort: addrPort,
addr: addr,
port: port,
ok: ok,
}
}
func splitAddrPortTestCases() []splitAddrPortCase {
return S(
newSplitAddrPortCase("empty", "", "", 0, false),
newSplitAddrPortCase("no host and port", ":6060", "::", 6060, true),
newSplitAddrPortCase("no host and bad port", ":606.0", "", 0, false),
newSplitAddrPortCase("no host and port out of range", ":123456", "", 0, false),
newSplitAddrPortCase("unspecified IPv4 short", "0:6060", "0.0.0.0", 6060, true),
newSplitAddrPortCase("unspecified IPv4", "0.0.0.0:6060", "0.0.0.0", 6060, true),
newSplitAddrPortCase("unspecified IPv6", "[::]:6060", "::", 6060, true),
newSplitAddrPortCase("IPv6 no port", "::1", "::1", 0, true),
newSplitAddrPortCase("bracketed IPv6 no port", "[::1]", "::1", 0, true),
newSplitAddrPortCase("bracketed IPv6 empty port", "[::1]:", "", 0, false),
newSplitAddrPortCase("bracketed IPv6 bad port", "[::1]:port", "", 0, false),
newSplitAddrPortCase("incomplete bracketed IPv6", "[::1:1234", "", 0, false),
newSplitAddrPortCase("bracketed IPv6 and port", "[::1]:1234", "::1", 1234, true),
newSplitAddrPortCase("IPv6 port out of range", "[::1]:123456", "", 0, false),
// A valid port but a host that isn't a literal IP forces
// ParseAddr to fail, covering the non-IP address branch.
newSplitAddrPortCase("hostname not IP", "name:1234", "", 0, false),
)
}
func TestSplitAddrPort(t *testing.T) {
RunTestCases(t, splitAddrPortTestCases())
}
type splitHostPortCase struct {
name string
hostport string
host, port string
ok bool
}
func (tc splitHostPortCase) Name() string {
return tc.name
}
func (tc splitHostPortCase) Test(t *testing.T) {
t.Helper()
h, p, err := SplitHostPort(tc.hostport)
if h != tc.host || p != tc.port || (err == nil) != tc.ok {
t.Errorf("SplitHostPort(%q) -> %q, %q, %#v", tc.hostport, h, p, err)
} else {
t.Logf("SplitHostPort(%q) -> %q, %q, %#v", tc.hostport, h, p, err)
}
}
func newSplitHostPortCase(name, hostport, host, port string, ok bool) splitHostPortCase {
return splitHostPortCase{
name: name,
hostport: hostport,
host: host,
port: port,
ok: ok,
}
}
func splitHostPortTestCases() []splitHostPortCase {
return S(
newSplitHostPortCase("empty", "", "", "", false),
newSplitHostPortCase("no host and port", ":6060", "::", "6060", true),
newSplitHostPortCase("no host and bad port", ":606.0", "", "", false),
newSplitHostPortCase("no host and port out of range", ":123456", "", "", false),
newSplitHostPortCase("unspecified IPv4 short", "0:6060", "0.0.0.0", "6060", true),
newSplitHostPortCase("unspecified IPv4", "0.0.0.0:6060", "0.0.0.0", "6060", true),
newSplitHostPortCase("unspecified IPv6", "[::]:6060", "::", "6060", true),
newSplitHostPortCase("hostname", "localhost", "localhost", "", true),
newSplitHostPortCase("IPv6 no port", "::1", "::1", "", true),
newSplitHostPortCase("bracketed IPv6 no port", "[::1]", "::1", "", true),
newSplitHostPortCase("bracketed IPv6 empty port", "[::1]:", "", "", false),
newSplitHostPortCase("bracketed IPv6 bad port", "[::1]:port", "", "", false),
newSplitHostPortCase("incomplete bracketed IPv6", "[::1:1234", "", "", false),
newSplitHostPortCase("bracketed IPv6 and port", "[::1]:1234", "::1", "1234", true),
newSplitHostPortCase("IPv6 port out of range", "[::1]:123456", "", "", false),
newSplitHostPortCase("name", "name", "name", "", true),
newSplitHostPortCase("name empty port", "name:", "", "", false),
newSplitHostPortCase("name and port", "name:1234", "name", "1234", true),
newSplitHostPortCase("name bad port", "name:123.4", "", "", false),
newSplitHostPortCase("name negative port", "name:-123.4", "", "", false),
newSplitHostPortCase("name port out of range", "name:123456", "", "", false),
newSplitHostPortCase("name non-numeric port", "name:port", "", "", false),
newSplitHostPortCase("bad hostname spaces", "bad name", "", "", false),
newSplitHostPortCase("bad hostname dots", "bad..name", "", "", false),
newSplitHostPortCase("bad hostname leading dot", ".name", "", "", false),
newSplitHostPortCase("international name", "Hello.\u4E16\u754C", "hello.\u4E16\u754C", "", true),
newSplitHostPortCase("puny code", "hello.xn--rhqv96g", "hello.\u4E16\u754C", "", true),
newSplitHostPortCase("good name", "good.name", "good.name", "", true),
newSplitHostPortCase("no host bad port", ":port", "", "", false),
// Trailing garbage after `]` exercises the default branch of
// splitHostPortBracketed.
newSplitHostPortCase("bracketed IPv6 trailing garbage", "[::1]x", "", "", false),
)
}
func TestSplitHostPort(t *testing.T) {
RunTestCases(t, splitHostPortTestCases())
}
type makeHostPortCase struct {
name string
hostPort string
expected string
ok bool
defaultPort uint16
}
func (tc makeHostPortCase) Name() string {
return tc.name
}
func (tc makeHostPortCase) Test(t *testing.T) {
t.Helper()
result, err := MakeHostPort(tc.hostPort, tc.defaultPort)
if (err == nil) != tc.ok || (tc.ok && result != tc.expected) {
t.Errorf("MakeHostPort(%q, %d) -> %q, %v; expected %q, ok=%v",
tc.hostPort, tc.defaultPort, result, err, tc.expected, tc.ok)
} else if tc.ok {
t.Logf("MakeHostPort(%q, %d) -> %q ✓", tc.hostPort, tc.defaultPort, result)
} else {
t.Logf("MakeHostPort(%q, %d) -> error: %v ✓", tc.hostPort, tc.defaultPort, err)
}
}
func newMakeHostPortCase(name, hostPort string, defaultPort uint16, expected string, ok bool) makeHostPortCase {
return makeHostPortCase{
name: name,
hostPort: hostPort,
expected: expected,
ok: ok,
defaultPort: defaultPort,
}
}
func makeHostPortTestCases() []makeHostPortCase {
return S(
// Valid cases with IP addresses
newMakeHostPortCase("IPv4 default port", "192.168.1.1", 8080, "192.168.1.1:8080", true),
newMakeHostPortCase("IPv4 explicit port", "192.168.1.1:9000", 8080, "192.168.1.1:9000", true),
newMakeHostPortCase("IPv4 no port", "192.168.1.1", 0, "192.168.1.1", true),
newMakeHostPortCase("IPv6 bracketed default port", "[::1]", 8080, "[::1]:8080", true),
newMakeHostPortCase("IPv6 bracketed explicit port", "[::1]:9000", 8080, "[::1]:9000", true),
newMakeHostPortCase("IPv6 bracketed no port", "[::1]", 0, "::1", true),
newMakeHostPortCase("IPv6 unbracketed default port", "::1", 8080, "[::1]:8080", true),
newMakeHostPortCase("IPv6 unbracketed no port", "::1", 0, "::1", true),
// Valid cases with hostnames
newMakeHostPortCase("hostname default port", "localhost", 8080, "localhost:8080", true),
newMakeHostPortCase("hostname explicit port", "localhost:9000", 8080, "localhost:9000", true),
newMakeHostPortCase("hostname no port", "localhost", 0, "localhost", true),
newMakeHostPortCase("FQDN default port", "example.com", 443, "example.com:443", true),
newMakeHostPortCase("FQDN explicit port", "example.com:80", 443, "example.com:80", true),
// Invalid cases
newMakeHostPortCase("empty input", "", 8080, "", false),
newMakeHostPortCase("invalid hostname", "invalid host", 8080, "", false),
newMakeHostPortCase("port 0 not allowed", "example.com:0", 8080, "", false),
newMakeHostPortCase("port out of range", "example.com:99999", 8080, "", false),
newMakeHostPortCase("invalid port", "example.com:invalid", 8080, "", false),
newMakeHostPortCase("malformed IPv6", "[::1", 8080, "", false),
newMakeHostPortCase("IPv6 invalid port", "[::1]:invalid", 8080, "", false),
)
}
func TestMakeHostPort(t *testing.T) {
RunTestCases(t, makeHostPortTestCases())
}
type joinHostPortCase struct {
name string
host string
port string
expected string
ok bool
}
func (tc joinHostPortCase) Name() string {
return tc.name
}
func (tc joinHostPortCase) Test(t *testing.T) {
t.Helper()
result, err := JoinHostPort(tc.host, tc.port)
if (err == nil) != tc.ok || (tc.ok && result != tc.expected) {
t.Errorf("JoinHostPort(%q, %q) -> %q, %v; expected %q, ok=%v",
tc.host, tc.port, result, err, tc.expected, tc.ok)
} else if tc.ok {
t.Logf("JoinHostPort(%q, %q) -> %q ✓", tc.host, tc.port, result)
} else {
t.Logf("JoinHostPort(%q, %q) -> error: %v ✓", tc.host, tc.port, err)
}
}
func newJoinHostPortCase(name, host, port, expected string, ok bool) joinHostPortCase {
return joinHostPortCase{
name: name,
host: host,
port: port,
expected: expected,
ok: ok,
}
}
func joinHostPortTestCases() []joinHostPortCase {
return S(
// Valid cases with IP addresses
newJoinHostPortCase("IPv4 with port", "192.168.1.1", "8080", "192.168.1.1:8080", true),
newJoinHostPortCase("IPv4 no port", "192.168.1.1", "", "192.168.1.1", true),
newJoinHostPortCase("IPv6 with port", "::1", "8080", "[::1]:8080", true),
newJoinHostPortCase("IPv6 no port", "::1", "", "::1", true),
newJoinHostPortCase("IPv6 long with port", "2001:db8::1", "9000", "[2001:db8::1]:9000", true),
newJoinHostPortCase("IPv6 long no port", "2001:db8::1", "", "2001:db8::1", true),
// Valid cases with hostnames
newJoinHostPortCase("hostname with port", "localhost", "8080", "localhost:8080", true),
newJoinHostPortCase("hostname no port", "localhost", "", "localhost", true),
newJoinHostPortCase("FQDN with port", "example.com", "443", "example.com:443", true),
newJoinHostPortCase("FQDN no port", "example.com", "", "example.com", true),
newJoinHostPortCase("subdomain with port", "sub.example.com", "80", "sub.example.com:80", true),
// Invalid cases
newJoinHostPortCase("empty host", "", "8080", "", false),
newJoinHostPortCase("invalid hostname", "invalid host", "8080", "", false),
newJoinHostPortCase("port 0 valid", "example.com", "0", "example.com:0", true),
newJoinHostPortCase("port out of range", "example.com", "99999", "", false),
newJoinHostPortCase("invalid port", "example.com", "invalid", "", false),
newJoinHostPortCase("negative port", "example.com", "-1", "", false),
newJoinHostPortCase("bad hostname dots", "bad..name", "8080", "", false),
newJoinHostPortCase("bad hostname leading dot", ".invalid", "8080", "", false),
)
}
func TestJoinHostPort(t *testing.T) {
RunTestCases(t, joinHostPortTestCases())
}
type doMakeHostPortCase struct {
name string
host string
port string
expected string
ok bool
defaultPort uint16
}
func (tc doMakeHostPortCase) Name() string {
return tc.name
}
func (tc doMakeHostPortCase) Test(t *testing.T) {
t.Helper()
result, err := doMakeHostPort(tc.host, tc.port, tc.defaultPort)
if (err == nil) != tc.ok || (tc.ok && result != tc.expected) {
t.Errorf("doMakeHostPort(%q, %q, %d) -> %q, %v; expected %q, ok=%v",
tc.host, tc.port, tc.defaultPort, result, err, tc.expected, tc.ok)
} else if tc.ok {
t.Logf("doMakeHostPort(%q, %q, %d) -> %q ✓", tc.host, tc.port, tc.defaultPort, result)
} else {
t.Logf("doMakeHostPort(%q, %q, %d) -> error: %v ✓", tc.host, tc.port, tc.defaultPort, err)
}
}
//revive:disable-next-line:argument-limit
func newDoMakeHostPortCase(name, host, port string, defaultPort uint16, expected string, ok bool) doMakeHostPortCase {
return doMakeHostPortCase{
name: name,
host: host,
port: port,
expected: expected,
ok: ok,
defaultPort: defaultPort,
}
}
func doMakeHostPortTestCases() []doMakeHostPortCase {
return S(
// Valid cases with explicit port
newDoMakeHostPortCase("explicit port used", "example.com", "8080", 9000, "example.com:8080", true),
newDoMakeHostPortCase("explicit port IPv4", "192.168.1.1", "443", 80, "192.168.1.1:443", true),
newDoMakeHostPortCase("explicit port IPv6", "[::1]", "9000", 8080, "[::1]:9000", true),
// Valid cases with default port
newDoMakeHostPortCase("default port used", "example.com", "", 8080, "example.com:8080", true),
newDoMakeHostPortCase("default port IPv4", "192.168.1.1", "", 443, "192.168.1.1:443", true),
newDoMakeHostPortCase("default port IPv6", "[::1]", "", 9000, "[::1]:9000", true),
// Valid cases with no port
newDoMakeHostPortCase("no port hostname", "example.com", "", 0, "example.com", true),
newDoMakeHostPortCase("no port IPv4", "192.168.1.1", "", 0, "192.168.1.1", true),
newDoMakeHostPortCase("no port IPv6", "[::1]", "", 0, "[::1]", true),
// Invalid cases
newDoMakeHostPortCase("port 0 not allowed", "example.com", "0", 8080, "", false),
newDoMakeHostPortCase("port 0 not allowed IPv4", "192.168.1.1", "0", 443, "", false),
newDoMakeHostPortCase("port 0 not allowed IPv6", "[::1]", "0", 9000, "", false),
)
}
func TestDoMakeHostPort(t *testing.T) {
RunTestCases(t, doMakeHostPortTestCases())
}
type doJoinHostPortCase struct {
name string
host string
port string
expected string
ok bool
}
func (tc doJoinHostPortCase) Name() string {
return tc.name
}
func (tc doJoinHostPortCase) Test(t *testing.T) {
t.Helper()
result, err := doJoinHostPort(tc.host, tc.port)
if (err == nil) != tc.ok || (tc.ok && result != tc.expected) {
t.Errorf("doJoinHostPort(%q, %q) -> %q, %v; expected %q, ok=%v",
tc.host, tc.port, result, err, tc.expected, tc.ok)
} else if tc.ok {
t.Logf("doJoinHostPort(%q, %q) -> %q ✓", tc.host, tc.port, result)
} else {
t.Logf("doJoinHostPort(%q, %q) -> error: %v ✓", tc.host, tc.port, err)
}
}
func newDoJoinHostPortCase(name, host, port, expected string, ok bool) doJoinHostPortCase {
return doJoinHostPortCase{
name: name,
host: host,
port: port,
expected: expected,
ok: ok,
}
}
func doJoinHostPortTestCases() []doJoinHostPortCase {
return S(
// Valid cases
newDoJoinHostPortCase("valid hostname", "example.com", "8080", "example.com:8080", true),
newDoJoinHostPortCase("valid IPv4", "192.168.1.1", "443", "192.168.1.1:443", true),
newDoJoinHostPortCase("valid IPv6", "[::1]", "9000", "[::1]:9000", true),
newDoJoinHostPortCase("valid hostname SSH", "localhost", "22", "localhost:22", true),
newDoJoinHostPortCase("valid subdomain", "sub.example.com", "80", "sub.example.com:80", true),
// Invalid cases
newDoJoinHostPortCase("port 0 valid", "example.com", "0", "example.com:0", true),
newDoJoinHostPortCase("port out of range", "192.168.1.1", "99999", "", false),
newDoJoinHostPortCase("invalid port", "[::1]", "invalid", "", false),
newDoJoinHostPortCase("negative port", "localhost", "-1", "", false),
newDoJoinHostPortCase("port out of range high", "example.com", "65536", "", false),
newDoJoinHostPortCase("non-numeric port", "test.com", "abc", "", false),
)
}
func TestDoJoinHostPort(t *testing.T) {
RunTestCases(t, doJoinHostPortTestCases())
}
type ipForHostPortCase struct {
name string
input string
expected string
}
func (tc ipForHostPortCase) Name() string {
return tc.name
}
func (tc ipForHostPortCase) Test(t *testing.T) {
t.Helper()
addr, err := ParseAddr(tc.input)
if err != nil {
t.Errorf("ParseAddr(%q) failed: %v", tc.input, err)
return
}
result := ipForHostPort(addr)
if result != tc.expected {
t.Errorf("ipForHostPort(%q) -> %q; expected %q", tc.input, result, tc.expected)
} else {
t.Logf("ipForHostPort(%q) -> %q ✓", tc.input, result)
}
}
func newIPForHostPortCase(name, input, expected string) ipForHostPortCase {
return ipForHostPortCase{
name: name,
input: input,
expected: expected,
}
}
func ipForHostPortTestCases() []ipForHostPortCase {
return S(
// IPv4 addresses (should not be bracketed)
newIPForHostPortCase("IPv4 localhost", "127.0.0.1", "127.0.0.1"),
newIPForHostPortCase("IPv4 private", "192.168.1.1", "192.168.1.1"),
newIPForHostPortCase("IPv4 private 10", "10.0.0.1", "10.0.0.1"),
newIPForHostPortCase("IPv4 private 172", "172.16.0.1", "172.16.0.1"),
newIPForHostPortCase("IPv4 unspecified", "0.0.0.0", "0.0.0.0"),
newIPForHostPortCase("IPv4 broadcast", "255.255.255.255", "255.255.255.255"),
// IPv6 addresses (should be bracketed)
newIPForHostPortCase("IPv6 localhost", "::1", "[::1]"),
newIPForHostPortCase("IPv6 unspecified", "::", "[::]"),
newIPForHostPortCase("IPv6 example", "2001:db8::1", "[2001:db8::1]"),
newIPForHostPortCase("IPv6 link-local", "fe80::1", "[fe80::1]"),
newIPForHostPortCase("IPv6 full", "2001:db8:85a3::8a2e:370:7334", "[2001:db8:85a3::8a2e:370:7334]"),
newIPForHostPortCase("IPv6 mapped", "::ffff:192.0.2.1", "[::ffff:192.0.2.1]"),
)
}
func TestIPForHostPort(t *testing.T) {
RunTestCases(t, ipForHostPortTestCases())
}
type addrErrCase struct {
name string
addr string
why string
}
func (tc addrErrCase) Name() string {
return tc.name
}
func (tc addrErrCase) Test(t *testing.T) {
t.Helper()
err := addrErr(tc.addr, tc.why)
// Check that it returns a *net.AddrError
addrErr, ok := err.(*net.AddrError)
if !ok {
t.Errorf("addrErr() should return *net.AddrError, got %T", err)
return
}
// Check the error details
if addrErr.Addr != tc.addr {
t.Errorf("addrErr.Addr = %q; expected %q", addrErr.Addr, tc.addr)
}
if addrErr.Err != tc.why {
t.Errorf("addrErr.Err = %q; expected %q", addrErr.Err, tc.why)
}
// Check the error message format (net.AddrError formats as "address <addr>: <err>")
var expectedMsg string
if tc.addr == "" {
expectedMsg = tc.why
} else {
expectedMsg = "address " + tc.addr + ": " + tc.why
}
if addrErr.Error() != expectedMsg {
t.Errorf("addrErr.Error() = %q; expected %q", addrErr.Error(), expectedMsg)
}
t.Logf("addrErr(%q, %q) -> %v ✓", tc.addr, tc.why, err)
}
func newAddrErrCase(name, addr, why string) addrErrCase {
return addrErrCase{
name: name,
addr: addr,
why: why,
}
}
func addrErrTestCases() []addrErrCase {
return S(
newAddrErrCase("basic error", "invalid.address", "test error"),
newAddrErrCase("empty addr", "", "empty address"),
newAddrErrCase("empty reason", "example.com", ""),
newAddrErrCase("special chars", "test@example.com", "invalid format"),
)
}
func TestAddrErr(t *testing.T) {
RunTestCases(t, addrErrTestCases())
}