MCPcopy Index your code
hub / github.com/coder/coder / TestPathStore_AddPaths_SkipsNilUUIDs

Function TestPathStore_AddPaths_SkipsNilUUIDs

agent/agentgit/pathstore_test.go:34–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func TestPathStore_AddPaths_SkipsNilUUIDs(t *testing.T) {
35 t.Parallel()
36
37 ps := agentgit.NewPathStore()
38
39 // A nil chatID should be a no-op.
40 ps.AddPaths([]uuid.UUID{uuid.Nil}, []string{"/x"})
41 require.Nil(t, ps.GetPaths(uuid.Nil))
42
43 // A nil ancestor should be silently skipped.
44 chatID := uuid.New()
45 ps.AddPaths([]uuid.UUID{chatID, uuid.Nil}, []string{"/y"})
46 require.Equal(t, []string{"/y"}, ps.GetPaths(chatID))
47 require.Nil(t, ps.GetPaths(uuid.Nil))
48}
49
50func TestPathStore_GetPaths_DeduplicatedSorted(t *testing.T) {
51 t.Parallel()

Callers

nothing calls this directly

Calls 5

AddPathsMethod · 0.95
GetPathsMethod · 0.95
NewPathStoreFunction · 0.92
NewMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected