diff options
author | Julian Berman <Julian@GrayVines.com> | 2020-07-25 16:11:56 -0400 |
---|---|---|
committer | Julian Berman <Julian@GrayVines.com> | 2020-07-25 16:11:56 -0400 |
commit | fc5a4a1a28e93f942fe3bf91fea24bfb1a0eaa98 (patch) | |
tree | 512426d6fa20480cf5a82abdb5ecd14751205666 /json/tests/draft4/optional/format | |
parent | dd31840bc29329534fc6a2eee23137893aa068d8 (diff) | |
parent | 95874db4df84775af2429ddea7afd006523cef08 (diff) | |
download | jsonschema-fc5a4a1a28e93f942fe3bf91fea24bfb1a0eaa98.tar.gz |
Merge commit '95874db4df84775af2429ddea7afd006523cef08'
* commit '95874db4df84775af2429ddea7afd006523cef08':
Squashed 'json/' changes from 40601f6..ea41553
Diffstat (limited to 'json/tests/draft4/optional/format')
-rw-r--r-- | json/tests/draft4/optional/format/email.json | 35 | ||||
-rw-r--r-- | json/tests/draft4/optional/format/ipv6.json | 52 |
2 files changed, 86 insertions, 1 deletions
diff --git a/json/tests/draft4/optional/format/email.json b/json/tests/draft4/optional/format/email.json index c837c84..02396d2 100644 --- a/json/tests/draft4/optional/format/email.json +++ b/json/tests/draft4/optional/format/email.json @@ -12,6 +12,41 @@ "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 } ] } diff --git a/json/tests/draft4/optional/format/ipv6.json b/json/tests/draft4/optional/format/ipv6.json index 131edb8..9b0881e 100644 --- a/json/tests/draft4/optional/format/ipv6.json +++ b/json/tests/draft4/optional/format/ipv6.json @@ -30,7 +30,7 @@ }, { "description": "leading colons is valid", - "data": "::1", + "data": "::42:ff:1", "valid": true }, { @@ -39,6 +39,21 @@ "valid": true }, { + "description": "missing leading octet is invalid", + "data": ":2:3:4:5:6:7:8", + "valid": false + }, + { + "description": "missing trailing octet is invalid", + "data": "1:2:3:4:5:6:7:", + "valid": false + }, + { + "description": "missing leading octet with omitted octets later", + "data": ":2:3:4::8", + "valid": false + }, + { "description": "two sets of double colons is invalid", "data": "1::d6::42", "valid": false @@ -62,6 +77,41 @@ "description": "mixed format with ipv4 section with a hex octet", "data": "1::2:192.168.ff.1", "valid": false + }, + { + "description": "mixed format with leading double colons (ipv4-mapped ipv6 address)", + "data": "::ffff:192.168.0.1", + "valid": true + }, + { + "description": "triple colons is invalid", + "data": "1:2:3:4:5:::8", + "valid": false + }, + { + "description": "8 octets", + "data": "1:2:3:4:5:6:7:8", + "valid": true + }, + { + "description": "insufficient octets without double colons", + "data": "1:2:3:4:5:6:7", + "valid": false + }, + { + "description": "no colons is invalid", + "data": "1", + "valid": false + }, + { + "description": "ipv4 is not ipv6", + "data": "127.0.0.1", + "valid": false + }, + { + "description": "ipv4 segment must have 4 octets", + "data": "1:2:3:4:1.2.3", + "valid": false } ] } |