summaryrefslogtreecommitdiff
path: root/json/tests/draft7/optional/format/ipv6.json
blob: 94368f2a0b9090eca16ff12ac1773e189989c638 (plain)
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
[
    {
        "description": "validation of IPv6 addresses",
        "schema": { "format": "ipv6" },
        "tests": [
            {
                "description": "all string formats ignore integers",
                "data": 12,
                "valid": true
            },
            {
                "description": "all string formats ignore floats",
                "data": 13.7,
                "valid": true
            },
            {
                "description": "all string formats ignore objects",
                "data": {},
                "valid": true
            },
            {
                "description": "all string formats ignore arrays",
                "data": [],
                "valid": true
            },
            {
                "description": "all string formats ignore booleans",
                "data": false,
                "valid": true
            },
            {
                "description": "all string formats ignore nulls",
                "data": null,
                "valid": true
            },
            {
                "description": "a valid IPv6 address",
                "data": "::1",
                "valid": true
            },
            {
                "description": "an IPv6 address with out-of-range values",
                "data": "12345::",
                "valid": false
            },
            {
                "description": "trailing 4 hex symbols is valid",
                "data": "::abef",
                "valid": true
            },
            {
                "description": "trailing 5 hex symbols is invalid",
                "data": "::abcef",
                "valid": false
            },
            {
                "description": "an IPv6 address with too many components",
                "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1",
                "valid": false
            },
            {
                "description": "an IPv6 address containing illegal characters",
                "data": "::laptop",
                "valid": false
            },
            {
                "description": "no digits is valid",
                "data": "::",
                "valid": true
            },
            {
                "description": "leading colons is valid",
                "data": "::42:ff:1",
                "valid": true
            },
            {
                "description": "trailing colons is valid",
                "data": "d6::",
                "valid": true
            },
            {
                "description": "missing leading octet is invalid",
                "data": ":2:3:4:5:6:7:8",
                "valid": false
            },
            {
                "description": "missing trailing octet is invalid",
                "data": "1:2:3:4:5:6:7:",
                "valid": false
            },
            {
                "description": "missing leading octet with omitted octets later",
                "data": ":2:3:4::8",
                "valid": false
            },
            {
                "description": "single set of double colons in the middle is valid",
                "data": "1:d6::42",
                "valid": true
            },
            {
                "description": "two sets of double colons is invalid",
                "data": "1::d6::42",
                "valid": false
            },
            {
                "description": "mixed format with the ipv4 section as decimal octets",
                "data": "1::d6:192.168.0.1",
                "valid": true
            },
            {
                "description": "mixed format with double colons between the sections",
                "data": "1:2::192.168.0.1",
                "valid": true
            },
            {
                "description": "mixed format with ipv4 section with octet out of range",
                "data": "1::2:192.168.256.1",
                "valid": false
            },
            {
                "description": "mixed format with ipv4 section with a hex octet",
                "data": "1::2:192.168.ff.1",
                "valid": false
            },
            {
                "description": "mixed format with leading double colons (ipv4-mapped ipv6 address)",
                "data": "::ffff:192.168.0.1",
                "valid": true
            },
            {
                "description": "triple colons is invalid",
                "data": "1:2:3:4:5:::8",
                "valid": false
            },
            {
                "description": "8 octets",
                "data": "1:2:3:4:5:6:7:8",
                "valid": true
            },
            {
                "description": "insufficient octets without double colons",
                "data": "1:2:3:4:5:6:7",
                "valid": false
            },
            {
                "description": "no colons is invalid",
                "data": "1",
                "valid": false
            },
            {
                "description": "ipv4 is not ipv6",
                "data": "127.0.0.1",
                "valid": false
            },
            {
                "description": "ipv4 segment must have 4 octets",
                "data": "1:2:3:4:1.2.3",
                "valid": false
            },
            {
                "description": "leading whitespace is invalid",
                "data": "  ::1",
                "valid": false
            },
            {
                "description": "trailing whitespace is invalid",
                "data": "::1  ",
                "valid": false
            },
            {
                "description": "netmask is not a part of ipv6 address",
                "data": "fe80::/64",
                "valid": false
            },
            {
                "description": "zone id is not a part of ipv6 address",
                "data": "fe80::a%eth1",
                "valid": false
            },
            {
                "description": "a long valid ipv6",
                "data": "1000:1000:1000:1000:1000:1000:255.255.255.255",
                "valid": true
            },
            {
                "description": "a long invalid ipv6, below length limit, first",
                "data": "100:100:100:100:100:100:255.255.255.255.255",
                "valid": false
            },
            {
                "description": "a long invalid ipv6, below length limit, second",
                "data": "100:100:100:100:100:100:100:255.255.255.255",
                "valid": false
            },
            {
                "description": "invalid non-ASCII '৪' (a Bengali 4)",
                "data": "1:2:3:4:5:6:7:৪",
                "valid": false
            },
            {
                "description": "invalid non-ASCII '৪' (a Bengali 4) in the IPv4 portion",
                "data": "1:2::192.16৪.0.1",
                "valid": false
            }
        ]
    }
]