Debian Codegraph @

share/tests/draft2019-09/optional/format/hostname.json

raw
1 [
2 {
3 "description": "validation of host names",
4 "schema": {
5 "$schema": "https://json-schema.org/draft/2019-09/schema",
6 "format": "hostname"
7 },
8 "tests": [
9 {
10 "description": "all string formats ignore integers",
11 "data": 12,
12 "valid": true
13 },
14 {
15 "description": "all string formats ignore floats",
16 "data": 13.7,
17 "valid": true
18 },
19 {
20 "description": "all string formats ignore objects",
21 "data": {},
22 "valid": true
23 },
24 {
25 "description": "all string formats ignore arrays",
26 "data": [],
27 "valid": true
28 },
29 {
30 "description": "all string formats ignore booleans",
31 "data": false,
32 "valid": true
33 },
34 {
35 "description": "all string formats ignore nulls",
36 "data": null,
37 "valid": true
38 },
39 {
40 "description": "a valid host name",
41 "data": "www.example.com",
42 "valid": true
43 },
44 {
45 "description": "single label",
46 "data": "hostname",
47 "valid": true
48 },
49 {
50 "description": "single label with digits",
51 "data": "h0stn4me",
52 "valid": true
53 },
54 {
55 "description": "single label starting with digit",
56 "data": "1host",
57 "valid": true
58 },
59 {
60 "description": "single label ending with digit",
61 "data": "hostnam3",
62 "valid": true
63 },
64 {
65 "description": "empty string",
66 "data": "",
67 "valid": false
68 },
69 {
70 "description": "single dot",
71 "data": ".",
72 "valid": false
73 },
74 {
75 "description": "leading dot",
76 "data": ".example",
77 "valid": false
78 },
79 {
80 "description": "trailing dot",
81 "data": "example.",
82 "valid": false
83 },
84 {
85 "description": "IDN label separator",
86 "data": "example\uff0ecom",
87 "valid": false
88 },
89 {
90 "description": "single label with hyphen",
91 "data": "host-name",
92 "valid": true
93 },
94 {
95 "description": "starts with hyphen",
96 "data": "-hostname",
97 "valid": false
98 },
99 {
100 "description": "ends with hyphen",
101 "data": "hostname-",
102 "valid": false
103 },
104 {
105 "description": "contains \"--\" in the 3rd and 4th position",
106 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1 https://tools.ietf.org/html/rfc5890#section-2.3.2.1",
107 "data": "XN--aa---o47jg78q",
108 "valid": false
109 },
110 {
111 "description": "contains underscore",
112 "data": "host_name",
113 "valid": false
114 },
115 {
116 "description": "exceeds maximum overall length (256)",
117 "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com",
118 "valid": false
119 },
120 {
121 "description": "maximum label length (63)",
122 "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com",
123 "valid": true
124 },
125 {
126 "description": "exceeds maximum label length (63)",
127 "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com",
128 "valid": false
129 }
130 ]
131 },
132 {
133 "description": "validation of A-label (punycode) host names",
134 "schema": {
135 "$schema": "https://json-schema.org/draft/2019-09/schema",
136 "format": "hostname"
137 },
138 "tests": [
139 {
140 "description": "invalid Punycode",
141 "comment": "https://tools.ietf.org/html/rfc5891#section-4.4 https://tools.ietf.org/html/rfc5890#section-2.3.2.1",
142 "data": "xn--X",
143 "valid": false
144 },
145 {
146 "description": "a valid host name (example.test in Hangul)",
147 "data": "xn--9n2bp8q.xn--9t4b11yi5a",
148 "valid": true
149 },
150 {
151 "description": "contains illegal char U+302E Hangul single dot tone mark",
152 "data": "xn--07jt112bpxg.xn--9t4b11yi5a",
153 "valid": false
154 },
155 {
156 "description": "Begins with a Spacing Combining Mark",
157 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2",
158 "data": "xn--hello-txk",
159 "valid": false
160 },
161 {
162 "description": "Begins with a Nonspacing Mark",
163 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2",
164 "data": "xn--hello-zed",
165 "valid": false
166 },
167 {
168 "description": "Begins with an Enclosing Mark",
169 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.2",
170 "data": "xn--hello-6bf",
171 "valid": false
172 },
173 {
174 "description": "Exceptions that are PVALID, left-to-right chars",
175 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6",
176 "data": "xn--zca29lwxobi7a",
177 "valid": true
178 },
179 {
180 "description": "Exceptions that are PVALID, right-to-left chars",
181 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6",
182 "data": "xn--qmbc",
183 "valid": true
184 },
185 {
186 "description": "Exceptions that are DISALLOWED, right-to-left chars",
187 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6",
188 "data": "xn--chb89f",
189 "valid": false
190 },
191 {
192 "description": "Exceptions that are DISALLOWED, left-to-right chars",
193 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.2 https://tools.ietf.org/html/rfc5892#section-2.6 Note: The two combining marks (U+302E and U+302F) are in the middle and not at the start",
194 "data": "xn--07jceefgh4c",
195 "valid": false
196 },
197 {
198 "description": "MIDDLE DOT with no preceding 'l'",
199 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3",
200 "data": "xn--al-0ea",
201 "valid": false
202 },
203 {
204 "description": "MIDDLE DOT with nothing preceding",
205 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3",
206 "data": "xn--l-fda",
207 "valid": false
208 },
209 {
210 "description": "MIDDLE DOT with no following 'l'",
211 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3",
212 "data": "xn--la-0ea",
213 "valid": false
214 },
215 {
216 "description": "MIDDLE DOT with nothing following",
217 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3",
218 "data": "xn--l-gda",
219 "valid": false
220 },
221 {
222 "description": "MIDDLE DOT with surrounding 'l's",
223 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.3",
224 "data": "xn--ll-0ea",
225 "valid": true
226 },
227 {
228 "description": "Greek KERAIA not followed by Greek",
229 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4",
230 "data": "xn--S-jib3p",
231 "valid": false
232 },
233 {
234 "description": "Greek KERAIA not followed by anything",
235 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4",
236 "data": "xn--wva3j",
237 "valid": false
238 },
239 {
240 "description": "Greek KERAIA followed by Greek",
241 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.4",
242 "data": "xn--wva3je",
243 "valid": true
244 },
245 {
246 "description": "Hebrew GERESH not preceded by Hebrew",
247 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5",
248 "data": "xn--A-2hc5h",
249 "valid": false
250 },
251 {
252 "description": "Hebrew GERESH not preceded by anything",
253 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5",
254 "data": "xn--5db1e",
255 "valid": false
256 },
257 {
258 "description": "Hebrew GERESH preceded by Hebrew",
259 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.5",
260 "data": "xn--4dbc5h",
261 "valid": true
262 },
263 {
264 "description": "Hebrew GERSHAYIM not preceded by Hebrew",
265 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6",
266 "data": "xn--A-2hc8h",
267 "valid": false
268 },
269 {
270 "description": "Hebrew GERSHAYIM not preceded by anything",
271 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6",
272 "data": "xn--5db3e",
273 "valid": false
274 },
275 {
276 "description": "Hebrew GERSHAYIM preceded by Hebrew",
277 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.6",
278 "data": "xn--4dbc8h",
279 "valid": true
280 },
281 {
282 "description": "KATAKANA MIDDLE DOT with no Hiragana, Katakana, or Han",
283 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7",
284 "data": "xn--defabc-k64e",
285 "valid": false
286 },
287 {
288 "description": "KATAKANA MIDDLE DOT with no other characters",
289 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7",
290 "data": "xn--vek",
291 "valid": false
292 },
293 {
294 "description": "KATAKANA MIDDLE DOT with Hiragana",
295 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7",
296 "data": "xn--k8j5u",
297 "valid": true
298 },
299 {
300 "description": "KATAKANA MIDDLE DOT with Katakana",
301 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7",
302 "data": "xn--bck0j",
303 "valid": true
304 },
305 {
306 "description": "KATAKANA MIDDLE DOT with Han",
307 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.7",
308 "data": "xn--vek778f",
309 "valid": true
310 },
311 {
312 "description": "Arabic-Indic digits mixed with Extended Arabic-Indic digits",
313 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.8",
314 "data": "xn--ngb6iyr",
315 "valid": false
316 },
317 {
318 "description": "Arabic-Indic digits not mixed with Extended Arabic-Indic digits",
319 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.8",
320 "data": "xn--ngba1o",
321 "valid": true
322 },
323 {
324 "description": "Extended Arabic-Indic digits not mixed with Arabic-Indic digits",
325 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.9",
326 "data": "xn--0-gyc",
327 "valid": true
328 },
329 {
330 "description": "ZERO WIDTH JOINER not preceded by Virama",
331 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf",
332 "data": "xn--11b2er09f",
333 "valid": false
334 },
335 {
336 "description": "ZERO WIDTH JOINER not preceded by anything",
337 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf",
338 "data": "xn--02b508i",
339 "valid": false
340 },
341 {
342 "description": "ZERO WIDTH JOINER preceded by Virama",
343 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.2 https://www.unicode.org/review/pr-37.pdf",
344 "data": "xn--11b2ezcw70k",
345 "valid": true
346 },
347 {
348 "description": "ZERO WIDTH NON-JOINER preceded by Virama",
349 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1",
350 "data": "xn--11b2ezcs70k",
351 "valid": true
352 },
353 {
354 "description": "ZERO WIDTH NON-JOINER not preceded by Virama but matches regexp",
355 "comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1 https://www.w3.org/TR/alreq/#h_disjoining_enforcement",
356 "data": "xn--ngba5hb2804a",
357 "valid": true
358 }
359 ]
360 }
361 ]