-
-
Notifications
You must be signed in to change notification settings - Fork 546
/
Copy pathcanonical-data.json
259 lines (259 loc) · 7.57 KB
/
canonical-data.json
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
{
"exercise": "variable-length-quantity",
"comments": [
"JSON doesn't allow hexadecimal literals.",
"All numbers are given as decimal literals instead.",
"An error should be expected for incomplete sequences.",
"It is highly recommended that your track's test generator display all numbers as hexadecimal literals."
],
"cases": [
{
"description": "Encode a series of integers, producing a series of bytes.",
"cases": [
{
"uuid": "35c9db2e-f781-4c52-b73b-8e76427defd0",
"description": "zero",
"property": "encode",
"input": {
"integers": [0]
},
"expected": [0]
},
{
"uuid": "be44d299-a151-4604-a10e-d4b867f41540",
"description": "arbitrary single byte",
"property": "encode",
"input": {
"integers": [64]
},
"expected": [64]
},
{
"uuid": "ea399615-d274-4af6-bbef-a1c23c9e1346",
"description": "largest single byte",
"property": "encode",
"input": {
"integers": [127]
},
"expected": [127]
},
{
"uuid": "77b07086-bd3f-4882-8476-8dcafee79b1c",
"description": "smallest double byte",
"property": "encode",
"input": {
"integers": [128]
},
"expected": [129, 0]
},
{
"uuid": "63955a49-2690-4e22-a556-0040648d6b2d",
"description": "arbitrary double byte",
"property": "encode",
"input": {
"integers": [8192]
},
"expected": [192, 0]
},
{
"uuid": "29da7031-0067-43d3-83a7-4f14b29ed97a",
"description": "largest double byte",
"property": "encode",
"input": {
"integers": [16383]
},
"expected": [255, 127]
},
{
"uuid": "3345d2e3-79a9-4999-869e-d4856e3a8e01",
"description": "smallest triple byte",
"property": "encode",
"input": {
"integers": [16384]
},
"expected": [129, 128, 0]
},
{
"uuid": "5df0bc2d-2a57-4300-a653-a75ee4bd0bee",
"description": "arbitrary triple byte",
"property": "encode",
"input": {
"integers": [1048576]
},
"expected": [192, 128, 0]
},
{
"uuid": "f51d8539-312d-4db1-945c-250222c6aa22",
"description": "largest triple byte",
"property": "encode",
"input": {
"integers": [2097151]
},
"expected": [255, 255, 127]
},
{
"uuid": "da78228b-544f-47b7-8bfe-d16b35bbe570",
"description": "smallest quadruple byte",
"property": "encode",
"input": {
"integers": [2097152]
},
"expected": [129, 128, 128, 0]
},
{
"uuid": "11ed3469-a933-46f1-996f-2231e05d7bb6",
"description": "arbitrary quadruple byte",
"property": "encode",
"input": {
"integers": [134217728]
},
"expected": [192, 128, 128, 0]
},
{
"uuid": "d5f3f3c3-e0f1-4e7f-aad0-18a44f223d1c",
"description": "largest quadruple byte",
"property": "encode",
"input": {
"integers": [268435455]
},
"expected": [255, 255, 255, 127]
},
{
"uuid": "91a18b33-24e7-4bfb-bbca-eca78ff4fc47",
"description": "smallest quintuple byte",
"property": "encode",
"input": {
"integers": [268435456]
},
"expected": [129, 128, 128, 128, 0]
},
{
"uuid": "5f34ff12-2952-4669-95fe-2d11b693d331",
"description": "arbitrary quintuple byte",
"property": "encode",
"input": {
"integers": [4278190080]
},
"expected": [143, 248, 128, 128, 0]
},
{
"uuid": "7489694b-88c3-4078-9864-6fe802411009",
"description": "maximum 32-bit integer input",
"property": "encode",
"input": {
"integers": [4294967295]
},
"expected": [143, 255, 255, 255, 127]
},
{
"uuid": "f9b91821-cada-4a73-9421-3c81d6ff3661",
"description": "two single-byte values",
"property": "encode",
"input": {
"integers": [64, 127]
},
"expected": [64, 127]
},
{
"uuid": "68694449-25d2-4974-ba75-fa7bb36db212",
"description": "two multi-byte values",
"property": "encode",
"input": {
"integers": [16384, 1193046]
},
"expected": [129, 128, 0, 200, 232, 86]
},
{
"uuid": "51a06b5c-de1b-4487-9a50-9db1b8930d85",
"description": "many multi-byte values",
"property": "encode",
"input": {
"integers": [8192, 1193046, 268435455, 0, 16383, 16384]
},
"expected": [192, 0, 200, 232, 86, 255, 255, 255, 127, 0, 255, 127, 129, 128, 0]
}
]
},
{
"description": "Decode a series of bytes, producing a series of integers.",
"cases": [
{
"uuid": "baa73993-4514-4915-bac0-f7f585e0e59a",
"description": "one byte",
"property": "decode",
"input": {
"integers": [127]
},
"expected": [127]
},
{
"uuid": "72e94369-29f9-46f2-8c95-6c5b7a595aee",
"description": "two bytes",
"property": "decode",
"input": {
"integers": [192, 0]
},
"expected": [8192]
},
{
"uuid": "df5a44c4-56f7-464e-a997-1db5f63ce691",
"description": "three bytes",
"property": "decode",
"input": {
"integers": [255, 255, 127]
},
"expected": [2097151]
},
{
"uuid": "1bb58684-f2dc-450a-8406-1f3452aa1947",
"description": "four bytes",
"property": "decode",
"input": {
"integers": [129, 128, 128, 0]
},
"expected": [2097152]
},
{
"uuid": "cecd5233-49f1-4dd1-a41a-9840a40f09cd",
"description": "maximum 32-bit integer",
"property": "decode",
"input": {
"integers": [143, 255, 255, 255, 127]
},
"expected": [4294967295]
},
{
"uuid": "e7d74ba3-8b8e-4bcb-858d-d08302e15695",
"description": "incomplete sequence causes error",
"property": "decode",
"input": {
"integers": [255]
},
"expected": {
"error": "incomplete sequence"
}
},
{
"uuid": "aa378291-9043-4724-bc53-aca1b4a3fcb6",
"description": "incomplete sequence causes error, even if value is zero",
"property": "decode",
"input": {
"integers": [128]
},
"expected": {
"error": "incomplete sequence"
}
},
{
"uuid": "a91e6f5a-c64a-48e3-8a75-ce1a81e0ebee",
"description": "multiple values",
"property": "decode",
"input": {
"integers": [192, 0, 200, 232, 86, 255, 255, 255, 127, 0, 255, 127, 129, 128, 0]
},
"expected": [8192, 1193046, 268435455, 0, 16383, 16384]
}
]
}
]
}