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

Function Test_findPath_Simple

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

Source from the content-addressed store, hash-verified

49}
50
51func Test_findPath_Simple(t *testing.T) {
52 m := buildTestMapper()
53 path, err := m.findPath(1, 3)
54 require.NoError(t, err)
55 require.Len(t, path, 2)
56
57 assert.Equal(t, "east", path[0].exitName)
58 assert.Equal(t, 2, path[0].roomId)
59 assert.False(t, path[0].waypoint)
60
61 assert.Equal(t, "south", path[1].exitName)
62 assert.Equal(t, 3, path[1].roomId)
63 assert.True(t, path[1].waypoint)
64}
65
66func Test_findPath_Unreachable(t *testing.T) {
67 m := NewMapper(1)

Callers

nothing calls this directly

Calls 3

buildTestMapperFunction · 0.85
findPathMethod · 0.80
LenMethod · 0.45

Tested by

no test coverage detected