Conversation
There was a problem hiding this comment.
Pull request overview
Adds substantial new JSON Schema email-format test coverage across all supported drafts to better exercise RFC 5321-valid cases (notably quoted-string local parts and address literals) and common edge/invalid cases.
Changes:
- Expands each draft’s
emailformat test suite with a large set of new valid/invalid examples. - Adds coverage for quoted-string local parts, IPv4/IPv6 address literals (incl. IPv6v4 hybrids), single-label domains, dotted-quad domains, and control/FWS/comment edge cases.
- Keeps the new cases largely consistent across drafts/v1 to make cross-implementation comparisons easier.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/v1/format/email.json | Adds expanded email-format test corpus for v1. |
| tests/draft7/optional/format/email.json | Adds expanded email-format test corpus for draft7 optional tests. |
| tests/draft6/optional/format/email.json | Adds expanded email-format test corpus for draft6 optional tests. |
| tests/draft4/optional/format/email.json | Adds expanded email-format test corpus for draft4 optional tests. |
| tests/draft3/optional/format/email.json | Adds expanded email-format test corpus for draft3 optional tests. |
| tests/draft2020-12/optional/format/email.json | Adds expanded email-format test corpus for 2020-12 optional tests. |
| tests/draft2019-09/optional/format/email.json | Adds expanded email-format test corpus for 2019-09 optional tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I'm not interested in what other test suites say, or what other implementations accept or reject. What do the relevant RFCs say about these test cases? You need to check these yourself: do not rely on AI. Until you've done this, I don't consider this PR to be mergeable. |
|
Sorry for the noise in the description thought it should be more informative and well structured so used AI to organise this. And also I have gone back through RFC 5321 §4.1.2 and §4.1.3 directly for every test. The bracket issue in test@[RFC-5322]-domain-literal] was a genuine mistake - fixed in the latest commit. The content after the first ] was outside the brackets which made the test ambiguous. Two tests I am genuinely unsure about and would appreciate guidance on: a@[extn:test] and a@[1111:2222:...:8888] without the IPv6: prefix. Both syntactically match the General-address-literal grammar in §4.1.3 (Standardized-tag ":" 1*dcontent) but §4.1.3 also says the tag MUST be IANA registered. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jviotti
left a comment
There was a problem hiding this comment.
I dropped one comment about a potentially duplicated tests, but overall I can't find anything non-compliant with these tests. They already increase coverage quite a lot more, which is great. E-mails are hard.
The existing email format files have between 11 and 27 tests per draft. I went through RFC 5321 §4.1.2 and §4.1.3 and added 148 new tests per draft covering the parts that were missing.
Coverage
"test"@iana.org,""@iana.org,"\""@iana.org,"\\"@iana.org," "@iana.org- RFC 5321 §4.1.2 definesLocal-part = Dot-string / Quoted-stringso both forms are valid. Also tests the tricky@inside quoted strings like"a@b"@iana.orgwhere the mailbox separator is the unquoted@.[255.255.255.255]), full and compressed IPv6, IPv6v4 hybrid forms ([IPv6:...:255.255.255.255]), and the invalid cases - wrong octet count, missingIPv6:prefix, empty brackets, leading space inside brackets.test@io), all-digit labels ([email protected]), dotted-quad without brackets ([email protected]), consecutive hyphens, hyphen at label boundaries.@signs, mixed dot-string and quoted-string, brackets in local-part position.One thing flagged for discussion:
a@[extn:test]syntactically matchesGeneral-address-literalin §4.1.3 but the MUST clause requires IANA registration. Currently marked invalid - been discussing with @jdesrosiers and @jviotti and happy to go either way based on consensus here.Draft Coverage