summaryrefslogtreecommitdiff
path: root/tests/draft2020-12/optional/format/email.json
diff options
context:
space:
mode:
Diffstat (limited to 'tests/draft2020-12/optional/format/email.json')
-rw-r--r--tests/draft2020-12/optional/format/email.json53
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/draft2020-12/optional/format/email.json b/tests/draft2020-12/optional/format/email.json
new file mode 100644
index 0000000..02396d2
--- /dev/null
+++ b/tests/draft2020-12/optional/format/email.json
@@ -0,0 +1,53 @@
+[
+ {
+ "description": "validation of e-mail addresses",
+ "schema": {"format": "email"},
+ "tests": [
+ {
+ "description": "a valid e-mail address",
+ "data": "joe.bloggs@example.com",
+ "valid": true
+ },
+ {
+ "description": "an invalid e-mail address",
+ "data": "2962",
+ "valid": false
+ },
+ {
+ "description": "tilde in local part is valid",
+ "data": "te~st@example.com",
+ "valid": true
+ },
+ {
+ "description": "tilde before local part is valid",
+ "data": "~test@example.com",
+ "valid": true
+ },
+ {
+ "description": "tilde after local part is valid",
+ "data": "test~@example.com",
+ "valid": true
+ },
+ {
+ "description": "dot before local part is not valid",
+ "data": ".test@example.com",
+ "valid": false
+ },
+ {
+ "description": "dot after local part is not valid",
+ "data": "test.@example.com",
+ "valid": false
+ },
+ {
+ "description": "two separated dots inside local part are valid",
+ "data": "te.s.t@example.com",
+ "valid": true
+ },
+ {
+ "description": "two subsequent dots inside local part are not valid",
+ "data": "te..st@example.com",
+ "valid": false
+ }
+ ]
+ }
+]