Debian Codegraph @

share/tests/draft7/optional/format/email.json

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