Skip to content

Commit 494676a

Browse files
test that format-assertions are valid with non-string types
1 parent b3e9063 commit 494676a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2400
-0
lines changed

tests/draft-future/optional/format/date-time.json

+30
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@
33
"description": "validation of date-time strings",
44
"schema": { "format": "date-time" },
55
"tests": [
6+
{
7+
"description": "all string formats ignore integers",
8+
"data": 12,
9+
"valid": true
10+
},
11+
{
12+
"description": "all string formats ignore floats",
13+
"data": 13.7,
14+
"valid": true
15+
},
16+
{
17+
"description": "all string formats ignore objects",
18+
"data": {},
19+
"valid": true
20+
},
21+
{
22+
"description": "all string formats ignore arrays",
23+
"data": [],
24+
"valid": true
25+
},
26+
{
27+
"description": "all string formats ignore booleans",
28+
"data": false,
29+
"valid": true
30+
},
31+
{
32+
"description": "all string formats ignore nulls",
33+
"data": null,
34+
"valid": true
35+
},
636
{
737
"description": "a valid date-time string",
838
"data": "1963-06-19T08:30:06.283185Z",

tests/draft-future/optional/format/date.json

+30
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@
33
"description": "validation of date strings",
44
"schema": { "format": "date" },
55
"tests": [
6+
{
7+
"description": "all string formats ignore integers",
8+
"data": 12,
9+
"valid": true
10+
},
11+
{
12+
"description": "all string formats ignore floats",
13+
"data": 13.7,
14+
"valid": true
15+
},
16+
{
17+
"description": "all string formats ignore objects",
18+
"data": {},
19+
"valid": true
20+
},
21+
{
22+
"description": "all string formats ignore arrays",
23+
"data": [],
24+
"valid": true
25+
},
26+
{
27+
"description": "all string formats ignore booleans",
28+
"data": false,
29+
"valid": true
30+
},
31+
{
32+
"description": "all string formats ignore nulls",
33+
"data": null,
34+
"valid": true
35+
},
636
{
737
"description": "a valid date string",
838
"data": "1963-06-19",

tests/draft-future/optional/format/duration.json

+30
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@
33
"description": "validation of duration strings",
44
"schema": { "format": "duration" },
55
"tests": [
6+
{
7+
"description": "all string formats ignore integers",
8+
"data": 12,
9+
"valid": true
10+
},
11+
{
12+
"description": "all string formats ignore floats",
13+
"data": 13.7,
14+
"valid": true
15+
},
16+
{
17+
"description": "all string formats ignore objects",
18+
"data": {},
19+
"valid": true
20+
},
21+
{
22+
"description": "all string formats ignore arrays",
23+
"data": [],
24+
"valid": true
25+
},
26+
{
27+
"description": "all string formats ignore booleans",
28+
"data": false,
29+
"valid": true
30+
},
31+
{
32+
"description": "all string formats ignore nulls",
33+
"data": null,
34+
"valid": true
35+
},
636
{
737
"description": "a valid duration string",
838
"data": "P4DT12H30M5S",

tests/draft-future/optional/format/email.json

+30
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@
33
"description": "validation of e-mail addresses",
44
"schema": { "format": "email" },
55
"tests": [
6+
{
7+
"description": "all string formats ignore integers",
8+
"data": 12,
9+
"valid": true
10+
},
11+
{
12+
"description": "all string formats ignore floats",
13+
"data": 13.7,
14+
"valid": true
15+
},
16+
{
17+
"description": "all string formats ignore objects",
18+
"data": {},
19+
"valid": true
20+
},
21+
{
22+
"description": "all string formats ignore arrays",
23+
"data": [],
24+
"valid": true
25+
},
26+
{
27+
"description": "all string formats ignore booleans",
28+
"data": false,
29+
"valid": true
30+
},
31+
{
32+
"description": "all string formats ignore nulls",
33+
"data": null,
34+
"valid": true
35+
},
636
{
737
"description": "a valid e-mail address",
838
"data": "[email protected]",

tests/draft-future/optional/format/hostname.json

+30
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@
33
"description": "validation of host names",
44
"schema": { "format": "hostname" },
55
"tests": [
6+
{
7+
"description": "all string formats ignore integers",
8+
"data": 12,
9+
"valid": true
10+
},
11+
{
12+
"description": "all string formats ignore floats",
13+
"data": 13.7,
14+
"valid": true
15+
},
16+
{
17+
"description": "all string formats ignore objects",
18+
"data": {},
19+
"valid": true
20+
},
21+
{
22+
"description": "all string formats ignore arrays",
23+
"data": [],
24+
"valid": true
25+
},
26+
{
27+
"description": "all string formats ignore booleans",
28+
"data": false,
29+
"valid": true
30+
},
31+
{
32+
"description": "all string formats ignore nulls",
33+
"data": null,
34+
"valid": true
35+
},
636
{
737
"description": "a valid host name",
838
"data": "www.example.com",

tests/draft-future/optional/format/idn-email.json

+30
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@
33
"description": "validation of an internationalized e-mail addresses",
44
"schema": { "format": "idn-email" },
55
"tests": [
6+
{
7+
"description": "all string formats ignore integers",
8+
"data": 12,
9+
"valid": true
10+
},
11+
{
12+
"description": "all string formats ignore floats",
13+
"data": 13.7,
14+
"valid": true
15+
},
16+
{
17+
"description": "all string formats ignore objects",
18+
"data": {},
19+
"valid": true
20+
},
21+
{
22+
"description": "all string formats ignore arrays",
23+
"data": [],
24+
"valid": true
25+
},
26+
{
27+
"description": "all string formats ignore booleans",
28+
"data": false,
29+
"valid": true
30+
},
31+
{
32+
"description": "all string formats ignore nulls",
33+
"data": null,
34+
"valid": true
35+
},
636
{
737
"description": "a valid idn e-mail ([email protected] in Hangul)",
838
"data": "실례@실례.테스트",

tests/draft-future/optional/format/idn-hostname.json

+30
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@
33
"description": "validation of internationalized host names",
44
"schema": { "format": "idn-hostname" },
55
"tests": [
6+
{
7+
"description": "all string formats ignore integers",
8+
"data": 12,
9+
"valid": true
10+
},
11+
{
12+
"description": "all string formats ignore floats",
13+
"data": 13.7,
14+
"valid": true
15+
},
16+
{
17+
"description": "all string formats ignore objects",
18+
"data": {},
19+
"valid": true
20+
},
21+
{
22+
"description": "all string formats ignore arrays",
23+
"data": [],
24+
"valid": true
25+
},
26+
{
27+
"description": "all string formats ignore booleans",
28+
"data": false,
29+
"valid": true
30+
},
31+
{
32+
"description": "all string formats ignore nulls",
33+
"data": null,
34+
"valid": true
35+
},
636
{
737
"description": "a valid host name (example.test in Hangul)",
838
"data": "실례.테스트",

tests/draft-future/optional/format/ipv4.json

+30
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@
33
"description": "validation of IP addresses",
44
"schema": { "format": "ipv4" },
55
"tests": [
6+
{
7+
"description": "all string formats ignore integers",
8+
"data": 12,
9+
"valid": true
10+
},
11+
{
12+
"description": "all string formats ignore floats",
13+
"data": 13.7,
14+
"valid": true
15+
},
16+
{
17+
"description": "all string formats ignore objects",
18+
"data": {},
19+
"valid": true
20+
},
21+
{
22+
"description": "all string formats ignore arrays",
23+
"data": [],
24+
"valid": true
25+
},
26+
{
27+
"description": "all string formats ignore booleans",
28+
"data": false,
29+
"valid": true
30+
},
31+
{
32+
"description": "all string formats ignore nulls",
33+
"data": null,
34+
"valid": true
35+
},
636
{
737
"description": "a valid IP address",
838
"data": "192.168.0.1",

tests/draft-future/optional/format/ipv6.json

+30
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@
33
"description": "validation of IPv6 addresses",
44
"schema": { "format": "ipv6" },
55
"tests": [
6+
{
7+
"description": "all string formats ignore integers",
8+
"data": 12,
9+
"valid": true
10+
},
11+
{
12+
"description": "all string formats ignore floats",
13+
"data": 13.7,
14+
"valid": true
15+
},
16+
{
17+
"description": "all string formats ignore objects",
18+
"data": {},
19+
"valid": true
20+
},
21+
{
22+
"description": "all string formats ignore arrays",
23+
"data": [],
24+
"valid": true
25+
},
26+
{
27+
"description": "all string formats ignore booleans",
28+
"data": false,
29+
"valid": true
30+
},
31+
{
32+
"description": "all string formats ignore nulls",
33+
"data": null,
34+
"valid": true
35+
},
636
{
737
"description": "a valid IPv6 address",
838
"data": "::1",

tests/draft-future/optional/format/iri-reference.json

+30
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@
33
"description": "validation of IRI References",
44
"schema": { "format": "iri-reference" },
55
"tests": [
6+
{
7+
"description": "all string formats ignore integers",
8+
"data": 12,
9+
"valid": true
10+
},
11+
{
12+
"description": "all string formats ignore floats",
13+
"data": 13.7,
14+
"valid": true
15+
},
16+
{
17+
"description": "all string formats ignore objects",
18+
"data": {},
19+
"valid": true
20+
},
21+
{
22+
"description": "all string formats ignore arrays",
23+
"data": [],
24+
"valid": true
25+
},
26+
{
27+
"description": "all string formats ignore booleans",
28+
"data": false,
29+
"valid": true
30+
},
31+
{
32+
"description": "all string formats ignore nulls",
33+
"data": null,
34+
"valid": true
35+
},
636
{
737
"description": "a valid IRI",
838
"data": "http://ƒøø.ßår/?∂éœ=πîx#πîüx",

0 commit comments

Comments
 (0)