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

Function TestCharacterIndex_AddOverwrite

internal/users/charindex_test.go:36–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

34}
35
36func TestCharacterIndex_AddOverwrite(t *testing.T) {
37 ci := freshCharacterIndex()
38 ci.Add("Aldric", 10)
39 ci.Add("Aldric", 20)
40
41 userId, found := ci.Find("Aldric")
42 if !found || userId != 20 {
43 t.Fatalf("expected overwritten userId 20, got (%d, %v)", userId, found)
44 }
45}
46
47func TestCharacterIndex_AddIdempotent(t *testing.T) {
48 ci := freshCharacterIndex()

Callers

nothing calls this directly

Calls 3

freshCharacterIndexFunction · 0.85
FindMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected