Skip to content

Additional examples consistent with RFC-5321 Mailbox grammar. #467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions tests/draft-next/optional/format/email.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,31 @@
"data": "[email protected]",
"valid": true
},
{
"description": "a quoted string with a space in the local part is valid",
"data": "\"joe bloggs\"@example.com",
"valid": true
},
{
"description": "a quoted string with a double dot in the local part is valid",
"data": "\"joe..bloggs\"@example.com",
"valid": true
},
{
"description": "a quoted string with a @ in the local part is valid",
"data": "\"joe@bloggs\"@example.com",
"valid": true
},
{
"description": "an IPv4-address-literal after the @ is valid",
"data": "joe.bloggs@[127.0.0.1]",
"valid": true
},
{
"description": "an IPv6-address-literal after the @ is valid",
"data": "joe.bloggs@[IPv6:::1]",
"valid": true
},
{
"description": "dot before local part is not valid",
"data": "[email protected]",
Expand All @@ -77,6 +102,16 @@
"description": "two subsequent dots inside local part are not valid",
"data": "[email protected]",
"valid": false
},
{
"description": "an invalid domain",
"data": "joe.bloggs@invalid=domain.com",
"valid": false
},
{
"description": "an invalid IPv4-address-literal",
"data": "joe.bloggs@[127.0.0.300]",
"valid": false
}
]
}
Expand Down
35 changes: 35 additions & 0 deletions tests/draft2020-12/optional/format/email.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,31 @@
"data": "[email protected]",
"valid": true
},
{
"description": "a quoted string with a space in the local part is valid",
"data": "\"joe bloggs\"@example.com",
"valid": true
},
{
"description": "a quoted string with a double dot in the local part is valid",
"data": "\"joe..bloggs\"@example.com",
"valid": true
},
{
"description": "a quoted string with a @ in the local part is valid",
"data": "\"joe@bloggs\"@example.com",
"valid": true
},
{
"description": "an IPv4-address-literal after the @ is valid",
"data": "joe.bloggs@[127.0.0.1]",
"valid": true
},
{
"description": "an IPv6-address-literal after the @ is valid",
"data": "joe.bloggs@[IPv6:::1]",
"valid": true
},
{
"description": "dot before local part is not valid",
"data": "[email protected]",
Expand All @@ -77,6 +102,16 @@
"description": "two subsequent dots inside local part are not valid",
"data": "[email protected]",
"valid": false
},
{
"description": "an invalid domain",
"data": "joe.bloggs@invalid=domain.com",
"valid": false
},
{
"description": "an invalid IPv4-address-literal",
"data": "joe.bloggs@[127.0.0.300]",
"valid": false
}
]
}
Expand Down