|
1 | 1 | {
|
2 | 2 | "exercise": "all-your-base",
|
3 |
| - "version": "1.2.0", |
| 3 | + "version": "2.0.0", |
4 | 4 | "comments": [
|
5 | 5 | "This canonical data makes the following choices:",
|
6 | 6 | "1. Zero is always represented in outputs as [0] instead of [].",
|
|
10 | 10 | "",
|
11 | 11 | "Tracks that wish to make different decisions for these choices may translate appropriately.",
|
12 | 12 | "",
|
13 |
| - "It's up to each track do decide:", |
14 |
| - "How should invalid input be handled?", |
15 |
| - "", |
16 |
| - "All the undefined cases are marked as null.", |
17 |
| - "", |
18 | 13 | "All your numeric-base are belong to [2..]. :)"
|
19 | 14 | ],
|
20 | 15 | "cases": [
|
|
120 | 115 | "input_base": 1,
|
121 | 116 | "input_digits": [],
|
122 | 117 | "output_base": 10,
|
123 |
| - "expected": null |
| 118 | + "expected": {"error": "input base must be >= 2"} |
124 | 119 | },
|
125 | 120 | {
|
126 | 121 | "description": "first base is zero",
|
127 | 122 | "property": "rebase",
|
128 | 123 | "input_base": 0,
|
129 | 124 | "input_digits": [],
|
130 | 125 | "output_base": 10,
|
131 |
| - "expected": null |
| 126 | + "expected": {"error": "input base must be >= 2"} |
132 | 127 | },
|
133 | 128 | {
|
134 | 129 | "description": "first base is negative",
|
135 | 130 | "property": "rebase",
|
136 | 131 | "input_base": -2,
|
137 | 132 | "input_digits": [1],
|
138 | 133 | "output_base": 10,
|
139 |
| - "expected": null |
| 134 | + "expected": {"error": "input base must be >= 2"} |
140 | 135 | },
|
141 | 136 | {
|
142 | 137 | "description": "negative digit",
|
143 | 138 | "property": "rebase",
|
144 | 139 | "input_base": 2,
|
145 | 140 | "input_digits": [1, -1, 1, 0, 1, 0],
|
146 | 141 | "output_base": 10,
|
147 |
| - "expected": null |
| 142 | + "expected": {"error": "all digits must satisfy 0 <= d < input base"} |
148 | 143 | },
|
149 | 144 | {
|
150 | 145 | "description": "invalid positive digit",
|
151 | 146 | "property": "rebase",
|
152 | 147 | "input_base": 2,
|
153 | 148 | "input_digits": [1, 2, 1, 0, 1, 0],
|
154 | 149 | "output_base": 10,
|
155 |
| - "expected": null |
| 150 | + "expected": {"error": "all digits must satisfy 0 <= d < input base"} |
156 | 151 | },
|
157 | 152 | {
|
158 | 153 | "description": "second base is one",
|
159 | 154 | "property": "rebase",
|
160 | 155 | "input_base": 2,
|
161 | 156 | "input_digits": [1, 0, 1, 0, 1, 0],
|
162 | 157 | "output_base": 1,
|
163 |
| - "expected": null |
| 158 | + "expected": {"error": "output base must be >= 2"} |
164 | 159 | },
|
165 | 160 | {
|
166 | 161 | "description": "second base is zero",
|
167 | 162 | "property": "rebase",
|
168 | 163 | "input_base": 10,
|
169 | 164 | "input_digits": [7],
|
170 | 165 | "output_base": 0,
|
171 |
| - "expected": null |
| 166 | + "expected": {"error": "output base must be >= 2"} |
172 | 167 | },
|
173 | 168 | {
|
174 | 169 | "description": "second base is negative",
|
175 | 170 | "property": "rebase",
|
176 | 171 | "input_base": 2,
|
177 | 172 | "input_digits": [1],
|
178 | 173 | "output_base": -7,
|
179 |
| - "expected": null |
| 174 | + "expected": {"error": "output base must be >= 2"} |
180 | 175 | },
|
181 | 176 | {
|
182 | 177 | "description": "both bases are negative",
|
183 | 178 | "property": "rebase",
|
184 | 179 | "input_base": -2,
|
185 | 180 | "input_digits": [1],
|
186 | 181 | "output_base": -7,
|
187 |
| - "expected": null |
| 182 | + "expected": {"error": "input base must be >= 2"} |
188 | 183 | }
|
189 | 184 | ]
|
190 | 185 | }
|
0 commit comments