Skip to content

Commit 9ddc632

Browse files
committed
chore(test-suite): regenerate YAML test suite
1 parent e04b45a commit 9ddc632

17 files changed

Lines changed: 313 additions & 0 deletions

File tree

lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/enum.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,3 +261,26 @@
261261
- description: do not match string lacking nul
262262
data: hellothere
263263
valid: false
264+
- description: empty enum
265+
schema:
266+
$schema: https://json-schema.org/draft/2019-09/schema
267+
enum: []
268+
tests:
269+
- description: string is invalid
270+
data: foo
271+
valid: false
272+
- description: number is invalid
273+
data: 42
274+
valid: false
275+
- description: null is invalid
276+
data: null
277+
valid: false
278+
- description: object is invalid
279+
data: {}
280+
valid: false
281+
- description: array is invalid
282+
data: []
283+
valid: false
284+
- description: boolean is invalid
285+
data: false
286+
valid: false

lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/maxContains.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,18 @@
8181
- 1
8282
- 1
8383
valid: false
84+
- description: maxContains = 0 with minContains = 0
85+
schema:
86+
$schema: https://json-schema.org/draft/2019-09/schema
87+
contains:
88+
const: 1
89+
minContains: 0
90+
maxContains: 0
91+
tests:
92+
- description: empty array
93+
data: []
94+
valid: true
95+
- description: one matching item
96+
data:
97+
- 1
98+
valid: false

lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/format/duration.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
- description: validation of duration strings
2+
comment: RFC 3339 Appendix A defines the ABNF grammar for ISO-8601 durations used by JSON Schema format 'duration'. These tests enforce only the syntax defined by that grammar.
23
schema:
34
$schema: https://json-schema.org/draft/2019-09/schema
45
format: duration
@@ -81,3 +82,52 @@
8182
- description: element without unit
8283
data: P1
8384
valid: false
85+
- description: all date and time components
86+
data: P1Y2M3DT4H5M6S
87+
valid: true
88+
- description: date components only
89+
data: P1Y2M3D
90+
valid: true
91+
- description: time components only
92+
data: PT1H2M3S
93+
valid: true
94+
- description: month and day
95+
data: P1M2D
96+
valid: true
97+
- description: hour and minute
98+
data: PT1H30M
99+
valid: true
100+
- description: multi-digit values in all components
101+
data: P10Y10M10DT10H10M10S
102+
valid: true
103+
- description: fractional duration is not allowed by RFC 3339 ABNF
104+
comment: numeric components use 1*DIGIT where DIGIT = %x30-39; '.' is not allowed
105+
data: PT0.5S
106+
valid: false
107+
- description: leading whitespace is invalid
108+
data: ' P1D'
109+
valid: false
110+
- description: trailing whitespace is invalid
111+
data: 'P1D '
112+
valid: false
113+
- description: empty string is invalid
114+
data: ""
115+
valid: false
116+
- description: years and months can appear without days
117+
data: P1Y2M
118+
valid: true
119+
- description: years and days cannot appear without months
120+
data: P1Y2D
121+
valid: false
122+
- description: months and days can appear without years
123+
data: P1M2D
124+
valid: true
125+
- description: hours and minutes can appear without seconds
126+
data: PT1H2M
127+
valid: true
128+
- description: hours and seconds cannot appear without minutes
129+
data: PT1H2S
130+
valid: false
131+
- description: minutes and seconds can appear without hour
132+
data: PT1M2S
133+
valid: true

lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/format/email.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,12 @@
5454
- description: full "From" header is invalid
5555
data: '"Winston Smith" <winston.smith@recdep.minitrue> (Records Department)'
5656
valid: false
57+
- description: local part is required
58+
data: '@example.com'
59+
valid: false
60+
- description: domain is required
61+
data: joe.bloggs@
62+
valid: false
63+
- description: unquoted space in local part is invalid
64+
data: joe bloggs@example.com
65+
valid: false

lib/src/testFixtures/resources/suite-yaml/tests/draft2019-09/optional/format/uri.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,21 @@
119119
comment: 'RFC 3986, Section 3.2.2: Fallback to reg-name allows digits and dots.'
120120
data: http://999.999.999.999/
121121
valid: true
122+
- description: invalid percent-encoding with non-hex digits
123+
data: http://example.com/%6G
124+
valid: false
125+
- description: incomplete percent-encoding triplet
126+
data: http://example.com/%A
127+
valid: false
128+
- description: lone percent sign is invalid
129+
data: http://example.com/%
130+
valid: false
131+
- description: scheme must start with a letter
132+
data: 1http://example.com
133+
valid: false
134+
- description: invalid character in scheme
135+
data: ht_tp://example.com
136+
valid: false
137+
- description: non-numeric port is invalid
138+
data: http://example.com:abc/path
139+
valid: false

lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/enum.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,3 +261,26 @@
261261
- description: do not match string lacking nul
262262
data: hellothere
263263
valid: false
264+
- description: empty enum
265+
schema:
266+
$schema: https://json-schema.org/draft/2020-12/schema
267+
enum: []
268+
tests:
269+
- description: string is invalid
270+
data: foo
271+
valid: false
272+
- description: number is invalid
273+
data: 42
274+
valid: false
275+
- description: null is invalid
276+
data: null
277+
valid: false
278+
- description: object is invalid
279+
data: {}
280+
valid: false
281+
- description: array is invalid
282+
data: []
283+
valid: false
284+
- description: boolean is invalid
285+
data: false
286+
valid: false

lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/maxContains.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,18 @@
8181
- 1
8282
- 1
8383
valid: false
84+
- description: maxContains = 0 with minContains = 0
85+
schema:
86+
$schema: https://json-schema.org/draft/2020-12/schema
87+
contains:
88+
const: 1
89+
minContains: 0
90+
maxContains: 0
91+
tests:
92+
- description: empty array
93+
data: []
94+
valid: true
95+
- description: one matching item
96+
data:
97+
- 1
98+
valid: false

lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/format-assertion.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
- description: 'schema that uses custom metaschema with format-assertion: false'
2+
comment: The true/false boolean in $vocabulary only controls behavior for implementations that do not recognize the vocabulary. For implementations that do understand format-assertion, the boolean has no impact on validation behavior — hence both test groups produce identical results.
23
schema:
34
$id: https://schema/using/format-assertion/false
45
$schema: http://localhost:1234/draft2020-12/format-assertion-false.json
@@ -8,6 +9,7 @@
89
data: 127.0.0.1
910
valid: true
1011
- description: 'format-assertion: false: invalid string'
12+
comment: 'valid: false is intentional — the false value in $vocabulary only affects unknown vocabulary handling, not validation behavior itself'
1113
data: not-an-ipv4
1214
valid: false
1315
- description: 'schema that uses custom metaschema with format-assertion: true'

lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/format/duration.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
- description: validation of duration strings
2+
comment: RFC 3339 Appendix A defines the ABNF grammar for ISO-8601 durations used by JSON Schema format 'duration'. These tests enforce only the syntax defined by that grammar.
23
schema:
34
$schema: https://json-schema.org/draft/2020-12/schema
45
format: duration
@@ -81,3 +82,52 @@
8182
- description: element without unit
8283
data: P1
8384
valid: false
85+
- description: all date and time components
86+
data: P1Y2M3DT4H5M6S
87+
valid: true
88+
- description: date components only
89+
data: P1Y2M3D
90+
valid: true
91+
- description: time components only
92+
data: PT1H2M3S
93+
valid: true
94+
- description: month and day
95+
data: P1M2D
96+
valid: true
97+
- description: hour and minute
98+
data: PT1H30M
99+
valid: true
100+
- description: multi-digit values in all components
101+
data: P10Y10M10DT10H10M10S
102+
valid: true
103+
- description: fractional duration is not allowed by RFC 3339 ABNF
104+
comment: numeric components use 1*DIGIT where DIGIT = %x30-39; '.' is not allowed
105+
data: PT0.5S
106+
valid: false
107+
- description: leading whitespace is invalid
108+
data: ' P1D'
109+
valid: false
110+
- description: trailing whitespace is invalid
111+
data: 'P1D '
112+
valid: false
113+
- description: empty string is invalid
114+
data: ""
115+
valid: false
116+
- description: years and months can appear without days
117+
data: P1Y2M
118+
valid: true
119+
- description: years and days cannot appear without months
120+
data: P1Y2D
121+
valid: false
122+
- description: months and days can appear without years
123+
data: P1M2D
124+
valid: true
125+
- description: hours and minutes can appear without seconds
126+
data: PT1H2M
127+
valid: true
128+
- description: hours and seconds cannot appear without minutes
129+
data: PT1H2S
130+
valid: false
131+
- description: minutes and seconds can appear without hour
132+
data: PT1M2S
133+
valid: true

lib/src/testFixtures/resources/suite-yaml/tests/draft2020-12/optional/format/email.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,12 @@
7575
- description: full "From" header is invalid
7676
data: '"Winston Smith" <winston.smith@recdep.minitrue> (Records Department)'
7777
valid: false
78+
- description: local part is required
79+
data: '@example.com'
80+
valid: false
81+
- description: domain is required
82+
data: joe.bloggs@
83+
valid: false
84+
- description: unquoted space in local part is invalid
85+
data: joe bloggs@example.com
86+
valid: false

0 commit comments

Comments
 (0)