( terrain: Terrain, actual: Option.Option<Graph.PathResult<number>>, sequence: Sequence )
| 73 | * Assert that the result path matches the expected path. |
| 74 | */ |
| 75 | const assertPath = ( |
| 76 | terrain: Terrain, |
| 77 | actual: Option.Option<Graph.PathResult<number>>, |
| 78 | sequence: Sequence |
| 79 | ) => { |
| 80 | const derived = sequenceFromPath(terrain, actual) |
| 81 | if (derived !== sequence) { |
| 82 | let message = "Path finding result did not match the expected sequence" |
| 83 | message += `\n` |
| 84 | message += `\nExpected: ${sequence}` |
| 85 | message += `\nActual: ${derived}` |
| 86 | message += `\n` |
| 87 | message += `\nExpected Path:` |
| 88 | message += `\n${printSolution(terrain, pathFromSequence(terrain, sequence))}` |
| 89 | message += `\n` |
| 90 | message += `\nActual Path:` |
| 91 | message += `\n${printSolution(terrain, Option.getOrUndefined(actual))}` |
| 92 | |
| 93 | throw new AssertionError({ message, stackStartFn: assertPath }) |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | type Sequence = `${number}:${number};${string}` |
| 98 |
no test coverage detected
searching dependent graphs…