(actualPath: string, expectedPath: string, precision: number, msg: string)
| 338 | } |
| 339 | |
| 340 | export function assertAreaPathCloseTo(actualPath: string, expectedPath: string, precision: number, msg: string) { |
| 341 | const actualAreaPathNumbers = tokenizePathString(actualPath); |
| 342 | const expectedAreaPathNumbers = tokenizePathString(expectedPath); |
| 343 | |
| 344 | assert.lengthOf(actualAreaPathNumbers, expectedAreaPathNumbers.length, `${msg}: number of numbers in each path should be equal`); |
| 345 | actualAreaPathNumbers.forEach((actualAreaNumber, i) => { |
| 346 | const expectedAreaNumber = expectedAreaPathNumbers[i]; |
| 347 | assert.closeTo(+actualAreaNumber, +expectedAreaNumber, 0.1, msg); |
| 348 | }); |
| 349 | } |
| 350 | |
| 351 | function tokenizePathString(pathString: string) { |
| 352 | const numbers: string[] = []; |
nothing calls this directly
no test coverage detected