Debian Codegraph @

share/tests/draft2020-12/optional/format/email.json

raw
1 [
2 {
3 "description": "validation of e-mail addresses",
4 "schema": {
5 "$schema": "https://json-schema.org/draft/2020-12/schema",
6 "format": "email"
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 e-mail address",
41 "data": "[email protected]",
42 "valid": true
43 },
44 {
45 "description": "an invalid e-mail address",
46 "data": "2962",
47 "valid": false
48 },
49 {
50 "description": "tilde in local part is valid",
51 "data": "[email protected]",
52 "valid": true
53 },
54 {
55 "description": "tilde before local part is valid",
56 "data": "[email protected]",
57 "valid": true
58 },
59 {
60 "description": "tilde after local part is valid",
61 "data": "[email protected]",
62 "valid": true
63 },
64 {
65 "description": "a quoted string with a space in the local part is valid",
66 "data": "\"joe bloggs\"@example.com",
67 "valid": true
68 },
69 {
70 "description": "a quoted string with a double dot in the local part is valid",
71 "data": "\"joe..bloggs\"@example.com",
72 "valid": true
73 },
74 {
75 "description": "a quoted string with a @ in the local part is valid",
76 "data": "\"joe@bloggs\"@example.com",
77 "valid": true
78 },
79 {
80 "description": "an IPv4-address-literal after the @ is valid",
81 "data": "joe.bloggs@[127.0.0.1]",
82 "valid": true
83 },
84 {
85 "description": "an IPv6-address-literal after the @ is valid",
86 "data": "joe.bloggs@[IPv6:::1]",
87 "valid": true
88 },
89 {
90 "description": "dot before local part is not valid",
91 "data": "[email protected]",
92 "valid": false
93 },
94 {
95 "description": "dot after local part is not valid",
96 "data": "[email protected]",
97 "valid": false
98 },
99 {
100 "description": "two separated dots inside local part are valid",
101 "data": "[email protected]",
102 "valid": true
103 },
104 {
105 "description": "two subsequent dots inside local part are not valid",
106 "data": "[email protected]",
107 "valid": false
108 },
109 {
110 "description": "an invalid domain",
111 "data": "joe.bloggs@invalid=domain.com",
112 "valid": false
113 },
114 {
115 "description": "an invalid IPv4-address-literal",
116 "data": "joe.bloggs@[127.0.0.300]",
117 "valid": false
118 },
119 {
120 "description": "two email addresses is not valid",
121 "data": "[email protected], [email protected]",
122 "valid": false
123 },
124 {
125 "description": "full \"From\" header is invalid",
126 "data": "\"Winston Smith\" <[email protected]> (Records Department)",
127 "valid": false
128 },
129 {
130 "description": "local part is required",
131 "data": "@example.com",
132 "valid": false
133 },
134 {
135 "description": "domain is required",
136 "data": "joe.bloggs@",
137 "valid": false
138 },
139 {
140 "description": "unquoted space in local part is invalid",
141 "data": "joe [email protected]",
142 "valid": false
143 },
144 {
145 "description": "a domain that looks like an IPv4 address without brackets is valid",
146 "data": "[email protected]",
147 "valid": true
148 },
149 {
150 "description": "an empty quoted string in the local part is valid",
151 "data": "\"\"@iana.org",
152 "valid": true
153 },
154 {
155 "description": "a quoted string containing only a space in the local part is valid",
156 "data": "\" \"@iana.org",
157 "valid": true
158 },
159 {
160 "description": "consecutive hyphens inside a domain label are valid",
161 "data": "[email protected]",
162 "valid": true
163 },
164 {
165 "description": "a domain label starting with a digit is valid",
166 "data": "[email protected]",
167 "valid": true
168 },
169 {
170 "description": "a non-ASCII character in the local part is not valid",
171 "data": "a\[email protected]",
172 "valid": false
173 },
174 {
175 "description": "a non-ASCII character in the domain is not valid",
176 "data": "a@\u00e9.org",
177 "valid": false
178 },
179 {
180 "description": "a fullwidth commercial at is not a valid separator",
181 "data": "a\uff20iana.org",
182 "valid": false
183 },
184 {
185 "description": "a non-ASCII character in a quoted pair is not valid",
186 "data": "\"test\\\u00a9\"@iana.org",
187 "valid": false
188 },
189 {
190 "description": "a trailing line feed is not valid",
191 "data": "[email protected]\n",
192 "valid": false
193 },
194 {
195 "description": "a trailing carriage return is not valid",
196 "data": "[email protected]\r",
197 "valid": false
198 },
199 {
200 "description": "a trailing space is not valid",
201 "data": "[email protected] ",
202 "valid": false
203 },
204 {
205 "description": "a leading space is not valid",
206 "data": " [email protected]",
207 "valid": false
208 },
209 {
210 "description": "a tab in the local part is not valid",
211 "data": "a\[email protected]",
212 "valid": false
213 },
214 {
215 "description": "a delete character in the local part is not valid",
216 "data": "\[email protected]",
217 "valid": false
218 },
219 {
220 "description": "a quoted string with no special characters in the local part is valid",
221 "data": "\"test\"@iana.org",
222 "valid": true
223 },
224 {
225 "description": "a quoted pair in the local part is valid",
226 "data": "\"\\a\"@iana.org",
227 "valid": true
228 },
229 {
230 "description": "an escaped double quote in the local part is valid",
231 "data": "\"\\\"\"@iana.org",
232 "valid": true
233 },
234 {
235 "description": "an escaped backslash in the local part is valid",
236 "data": "\"\\\\\"@iana.org",
237 "valid": true
238 },
239 {
240 "description": "an unescaped double quote in an unquoted local part is not valid",
241 "data": "test\"@iana.org",
242 "valid": false
243 },
244 {
245 "description": "text after the closing double quote in the local part is not valid",
246 "data": "\"test\"[email protected]",
247 "valid": false
248 },
249 {
250 "description": "an unclosed double quote in the local part is not valid",
251 "data": "\"[email protected]",
252 "valid": false
253 },
254 {
255 "description": "two unquoted @ signs are not valid",
256 "data": "a@[email protected]",
257 "valid": false
258 },
259 {
260 "description": "a backslash-escaped @ in an unquoted local part is not valid",
261 "data": "test\\@[email protected]",
262 "valid": false
263 },
264 {
265 "description": "an address literal in the local part position is not valid",
266 "data": "[1.2.3.4]@iana.org",
267 "valid": false
268 },
269 {
270 "description": "an empty string is not valid",
271 "data": "",
272 "valid": false
273 },
274 {
275 "description": "a domain label starting with a hyphen is not valid",
276 "data": "[email protected]",
277 "valid": false
278 },
279 {
280 "description": "a domain label ending with a hyphen is not valid",
281 "data": "[email protected]",
282 "valid": false
283 },
284 {
285 "description": "a domain starting with a dot is not valid",
286 "data": "[email protected]",
287 "valid": false
288 },
289 {
290 "description": "a domain ending with a dot is not valid",
291 "data": "[email protected].",
292 "valid": false
293 },
294 {
295 "description": "two subsequent dots inside the domain are not valid",
296 "data": "[email protected]",
297 "valid": false
298 },
299 {
300 "description": "a single-label domain is valid",
301 "data": "test@io",
302 "valid": true
303 },
304 {
305 "description": "an unclosed address literal is not valid",
306 "data": "test@[1.2.3.4",
307 "valid": false
308 },
309 {
310 "description": "empty brackets after the @ are not valid",
311 "data": "a@[]",
312 "valid": false
313 },
314 {
315 "description": "an IPv4-address-literal with three octets is not valid",
316 "data": "a@[1.2.3]",
317 "valid": false
318 },
319 {
320 "description": "an IPv4-address-literal with five octets is not valid",
321 "data": "a@[1.2.3.4.5]",
322 "valid": false
323 },
324 {
325 "description": "bracketed content that is not an address is not valid",
326 "data": "test@[RFC-5322-domain-literal]",
327 "valid": false
328 },
329 {
330 "description": "a domain label before the opening bracket is not valid",
331 "data": "test@a[255.255.255.255]",
332 "valid": false
333 },
334 {
335 "description": "a lowercase IPv6 tag in an address literal is valid",
336 "data": "a@[ipv6:::1]",
337 "valid": true
338 },
339 {
340 "description": "a comma in an unquoted local part is not valid",
341 "data": "a,[email protected]",
342 "valid": false
343 },
344 {
345 "description": "a semicolon in an unquoted local part is not valid",
346 "data": "a;[email protected]",
347 "valid": false
348 },
349 {
350 "description": "a colon in an unquoted local part is not valid",
351 "data": "a:[email protected]",
352 "valid": false
353 },
354 {
355 "description": "a parenthesis in an unquoted local part is not valid",
356 "comment": "a comment is RFC 5322 syntax, which the RFC 5321 Mailbox grammar does not have",
357 "data": "test(comment)@iana.org",
358 "valid": false
359 },
360 {
361 "description": "a parenthesis in the domain is not valid",
362 "comment": "a comment is RFC 5322 syntax, which the RFC 5321 Mailbox grammar does not have",
363 "data": "a@b(c).org",
364 "valid": false
365 }
366 ]
367 }
368 ]