summaryrefslogtreecommitdiff
path: root/tests/draft2020-12/optional/format/time.json
blob: 8967932e92b201407b861d1265e2ba01efe49b2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
[
    {
        "description": "validation of time strings",
        "schema": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "format": "time"
        },
        "tests": [
            {
                "description": "all string formats ignore integers",
                "data": 12,
                "valid": true
            },
            {
                "description": "all string formats ignore floats",
                "data": 13.7,
                "valid": true
            },
            {
                "description": "all string formats ignore objects",
                "data": {},
                "valid": true
            },
            {
                "description": "all string formats ignore arrays",
                "data": [],
                "valid": true
            },
            {
                "description": "all string formats ignore booleans",
                "data": false,
                "valid": true
            },
            {
                "description": "all string formats ignore nulls",
                "data": null,
                "valid": true
            },
            {
                "description": "a valid time string",
                "data": "08:30:06Z",
                "valid": true
            },
            {
                "description": "invalid time string with extra leading zeros",
                "data": "008:030:006Z",
                "valid": false
            },
            {
                "description": "invalid time string with no leading zero for single digit",
                "data": "8:3:6Z",
                "valid": false
            },
            {
                "description": "hour, minute, second must be two digits",
                "data": "8:0030:6Z",
                "valid": false
            },
            {
                "description": "a valid time string with leap second, Zulu",
                "data": "23:59:60Z",
                "valid": true
            },
            {
                "description": "invalid leap second, Zulu (wrong hour)",
                "data": "22:59:60Z",
                "valid": false
            },
            {
                "description": "invalid leap second, Zulu (wrong minute)",
                "data": "23:58:60Z",
                "valid": false
            },
            {
                "description": "valid leap second, zero time-offset",
                "data": "23:59:60+00:00",
                "valid": true
            },
            {
                "description": "invalid leap second, zero time-offset (wrong hour)",
                "data": "22:59:60+00:00",
                "valid": false
            },
            {
                "description": "invalid leap second, zero time-offset (wrong minute)",
                "data": "23:58:60+00:00",
                "valid": false
            },
            {
                "description": "valid leap second, positive time-offset",
                "data": "01:29:60+01:30",
                "valid": true
            },
            {
                "description": "valid leap second, large positive time-offset",
                "data": "23:29:60+23:30",
                "valid": true
            },
            {
                "description": "invalid leap second, positive time-offset (wrong hour)",
                "data": "23:59:60+01:00",
                "valid": false
            },
            {
                "description": "invalid leap second, positive time-offset (wrong minute)",
                "data": "23:59:60+00:30",
                "valid": false
            },
            {
                "description": "valid leap second, negative time-offset",
                "data": "15:59:60-08:00",
                "valid": true
            },
            {
                "description": "valid leap second, large negative time-offset",
                "data": "00:29:60-23:30",
                "valid": true
            },
            {
                "description": "invalid leap second, negative time-offset (wrong hour)",
                "data": "23:59:60-01:00",
                "valid": false
            },
            {
                "description": "invalid leap second, negative time-offset (wrong minute)",
                "data": "23:59:60-00:30",
                "valid": false
            },
            {
                "description": "a valid time string with second fraction",
                "data": "23:20:50.52Z",
                "valid": true
            },
            {
                "description": "a valid time string with precise second fraction",
                "data": "08:30:06.283185Z",
                "valid": true
            },
            {
                "description": "a valid time string with plus offset",
                "data": "08:30:06+00:20",
                "valid": true
            },
            {
                "description": "a valid time string with minus offset",
                "data": "08:30:06-08:00",
                "valid": true
            },
            {
                "description": "hour, minute in time-offset must be two digits",
                "data": "08:30:06-8:000",
                "valid": false
            },
            {
                "description": "a valid time string with case-insensitive Z",
                "data": "08:30:06z",
                "valid": true
            },
            {
                "description": "an invalid time string with invalid hour",
                "data": "24:00:00Z",
                "valid": false
            },
            {
                "description": "an invalid time string with invalid minute",
                "data": "00:60:00Z",
                "valid": false
            },
            {
                "description": "an invalid time string with invalid second",
                "data": "00:00:61Z",
                "valid": false
            },
            {
                "description": "an invalid time string with invalid leap second (wrong hour)",
                "data": "22:59:60Z",
                "valid": false
            },
            {
                "description": "an invalid time string with invalid leap second (wrong minute)",
                "data": "23:58:60Z",
                "valid": false
            },
            {
                "description": "an invalid time string with invalid time numoffset hour",
                "data": "01:02:03+24:00",
                "valid": false
            },
            {
                "description": "an invalid time string with invalid time numoffset minute",
                "data": "01:02:03+00:60",
                "valid": false
            },
            {
                "description": "an invalid time string with invalid time with both Z and numoffset",
                "data": "01:02:03Z+00:30",
                "valid": false
            },
            {
                "description": "an invalid offset indicator",
                "data": "08:30:06 PST",
                "valid": false
            },
            {
                "description": "only RFC3339 not all of ISO 8601 are valid",
                "data": "01:01:01,1111",
                "valid": false
            },
            {
                "description": "no time offset",
                "data": "12:00:00",
                "valid": false
            },
            {
                "description": "no time offset with second fraction",
                "data": "12:00:00.52",
                "valid": false
            },
            {
                "description": "invalid non-ASCII '২' (a Bengali 2)",
                "data": "1২:00:00Z",
                "valid": false
            },
            {
                "description": "offset not starting with plus or minus",
                "data": "08:30:06#00:20",
                "valid": false
            },
            {
                "description": "contains letters",
                "data": "ab:cd:ef",
                "valid": false
            }
        ]
    }
]