MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / Test_findPath_RoomNotFound

Function Test_findPath_RoomNotFound

internal/mapper/mapper.path_test.go:38–49  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

36}
37
38func Test_findPath_RoomNotFound(t *testing.T) {
39 m := NewMapper(1)
40 m.crawledRooms = map[int]*mapNode{
41 1: {RoomId: 1, Pos: positionDelta{}, Exits: map[string]nodeExit{}},
42 }
43
44 _, err := m.findPath(1, 2)
45 assert.ErrorIs(t, err, ErrRoomNotFound, "expected ErrRoomNotFound for missing dest")
46
47 _, err = m.findPath(2, 1)
48 assert.ErrorIs(t, err, ErrRoomNotFound, "expected ErrRoomNotFound for missing source")
49}
50
51func Test_findPath_Simple(t *testing.T) {
52 m := buildTestMapper()

Callers

nothing calls this directly

Calls 2

NewMapperFunction · 0.85
findPathMethod · 0.80

Tested by

no test coverage detected