Skip to content

Commit b6a2263

Browse files
committed
test(idn-email): add Unicode NFC normalization cases
1 parent 60755c1 commit b6a2263

4 files changed

Lines changed: 40 additions & 0 deletions

File tree

tests/draft2019-09/optional/format/idn-email.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@
5050
"description": "a valid e-mail address",
5151
"data": "joe.bloggs@example.com",
5252
"valid": true
53+
},
54+
{
55+
"description": "a domain label that is not in Unicode NFC is invalid",
56+
"data": "user@cafe\u0301.com",
57+
"valid": false
58+
},
59+
{
60+
"description": "a local part that is not in Unicode NFC is valid",
61+
"data": "cafe\u0301@example.com",
62+
"valid": true
5363
}
5464
]
5565
}

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@
5050
"description": "a valid e-mail address",
5151
"data": "joe.bloggs@example.com",
5252
"valid": true
53+
},
54+
{
55+
"description": "a domain label that is not in Unicode NFC is invalid",
56+
"data": "user@cafe\u0301.com",
57+
"valid": false
58+
},
59+
{
60+
"description": "a local part that is not in Unicode NFC is valid",
61+
"data": "cafe\u0301@example.com",
62+
"valid": true
5363
}
5464
]
5565
}

tests/draft7/optional/format/idn-email.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@
4747
"description": "a valid e-mail address",
4848
"data": "joe.bloggs@example.com",
4949
"valid": true
50+
},
51+
{
52+
"description": "a domain label that is not in Unicode NFC is invalid",
53+
"data": "user@cafe\u0301.com",
54+
"valid": false
55+
},
56+
{
57+
"description": "a local part that is not in Unicode NFC is valid",
58+
"data": "cafe\u0301@example.com",
59+
"valid": true
5060
}
5161
]
5262
}

tests/v1/format/idn-email.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@
5555
"description": "an invalid e-mail address",
5656
"data": "2962",
5757
"valid": false
58+
},
59+
{
60+
"description": "a domain label that is not in Unicode NFC is invalid",
61+
"data": "user@cafe\u0301.com",
62+
"valid": false
63+
},
64+
{
65+
"description": "a local part that is not in Unicode NFC is valid",
66+
"data": "cafe\u0301@example.com",
67+
"valid": true
5868
}
5969
]
6070
}

0 commit comments

Comments
 (0)