File tree Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change
1
+ use Test ;
2
+
3
+ # RT #130473, #130475
4
+
5
+ constant HOST = ' localhost' ;
6
+
7
+ constant FAMILY_VALUE_TOO_LOW = 1 ;
8
+ constant FAMILY_VALUE_TOO_HIGH = 4 ;
9
+
10
+ constant PORT_VALUE_VALID = 5018 ;
11
+ constant PORT_VALUE_TOO_LOW = -1 ;
12
+ constant PORT_VALUE_TOO_HIGH = 65_536 ;
13
+
14
+ plan 4 ;
15
+
16
+ dies-ok & port-too-low , ' Fails when port is too low' ;
17
+
18
+ dies-ok & port-too-high , ' Fails when port is too high' ;
19
+
20
+ dies-ok & family-too-low , ' Fails when family is too low' ;
21
+
22
+ dies-ok & family-too-high , ' Fails when family is too high' ;
23
+
24
+ done-testing ;
25
+
26
+ sub port-too-low () {
27
+ my $ listen = IO ::Socket::INET. new (
28
+ : listen,
29
+ : localhost(HOST),
30
+ : localport(PORT_VALUE_TOO_LOW),
31
+ );
32
+ }
33
+
34
+ sub port-too-high () {
35
+ my $ listen = IO ::Socket::INET. new (
36
+ : listen,
37
+ : localhost(HOST),
38
+ : localport(PORT_VALUE_TOO_HIGH),
39
+ );
40
+ }
41
+
42
+ sub family-too-low () {
43
+ my $ listen = IO ::Socket::INET. new (
44
+ : listen,
45
+ : localhost(HOST),
46
+ : localport(PORT_VALUE_VALID),
47
+ : family(FAMILY_VALUE_TOO_LOW),
48
+ );
49
+ }
50
+
51
+ sub family-too-high () {
52
+ my $ listen = IO ::Socket::INET. new (
53
+ : listen,
54
+ : localhost(HOST),
55
+ : localport(PORT_VALUE_VALID),
56
+ : family(FAMILY_VALUE_TOO_HIGH),
57
+ );
58
+ }
You can’t perform that action at this time.
0 commit comments