Skip to content

Commit 060caae

Browse files
authored
Merge pull request #467 from gene-hightower/strict-rfc-grammar
Additional examples consistent with RFC-5321 Mailbox grammar.
2 parents 637f0ac + 995932c commit 060caae

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

tests/draft-next/optional/format/email.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,31 @@
5858
"data": "test~@example.com",
5959
"valid": true
6060
},
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+
},
6186
{
6287
"description": "dot before local part is not valid",
6388
"data": ".test@example.com",
@@ -77,6 +102,16 @@
77102
"description": "two subsequent dots inside local part are not valid",
78103
"data": "te..st@example.com",
79104
"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
80115
}
81116
]
82117
}

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,31 @@
5858
"data": "test~@example.com",
5959
"valid": true
6060
},
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+
},
6186
{
6287
"description": "dot before local part is not valid",
6388
"data": ".test@example.com",
@@ -77,6 +102,16 @@
77102
"description": "two subsequent dots inside local part are not valid",
78103
"data": "te..st@example.com",
79104
"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
80115
}
81116
]
82117
}

0 commit comments

Comments
 (0)