buildCycleMapper creates a graph with a cycle: 1 <-> 2 -> 3
()
| 20 | |
| 21 | // buildCycleMapper creates a graph with a cycle: 1 <-> 2 -> 3 |
| 22 | func buildCycleMapper() *mapper { |
| 23 | m := NewMapper(1) |
| 24 | m.crawledRooms = map[int]*mapNode{ |
| 25 | 1: {RoomId: 1, Pos: positionDelta{x: 0, y: 0, z: 0}, Exits: map[string]nodeExit{"to2": {RoomId: 2}}}, |
| 26 | 2: {RoomId: 2, Pos: positionDelta{x: 1, y: 0, z: 0}, Exits: map[string]nodeExit{"to1": {RoomId: 1}, "to3": {RoomId: 3}}}, |
| 27 | 3: {RoomId: 3, Pos: positionDelta{x: 2, y: 0, z: 0}, Exits: map[string]nodeExit{}}, |
| 28 | } |
| 29 | return m |
| 30 | } |
| 31 | |
| 32 | func Test_findPath_DestMatch(t *testing.T) { |
| 33 | m := buildTestMapper() |
no test coverage detected