| 185 | '918854443121279438895193'); |
| 186 | |
| 187 | function check(actual, expected, input) { |
| 188 | assert(!(actual instanceof Object)); |
| 189 | const actualKeys = Object.keys(actual).sort(); |
| 190 | const expectedKeys = Object.keys(expected).sort(); |
| 191 | let msg; |
| 192 | if (typeof input === 'string') { |
| 193 | msg = `Input: ${inspect(input)}\n` + |
| 194 | `Actual keys: ${inspect(actualKeys)}\n` + |
| 195 | `Expected keys: ${inspect(expectedKeys)}`; |
| 196 | } |
| 197 | assert.deepStrictEqual(actualKeys, expectedKeys, msg); |
| 198 | expectedKeys.forEach((key) => { |
| 199 | if (typeof input === 'string') { |
| 200 | msg = `Input: ${inspect(input)}\n` + |
| 201 | `Key: ${inspect(key)}\n` + |
| 202 | `Actual value: ${inspect(actual[key])}\n` + |
| 203 | `Expected value: ${inspect(expected[key])}`; |
| 204 | } else { |
| 205 | msg = undefined; |
| 206 | } |
| 207 | assert.deepStrictEqual(actual[key], expected[key], msg); |
| 208 | }); |
| 209 | } |
| 210 | |
| 211 | // Test that the canonical qs is parsed properly. |
| 212 | qsTestCases.forEach((testCase) => { |