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

Function TestPathStore_Notify_SkipsNilUUIDs

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

Source from the content-addressed store, hash-verified

171}
172
173func TestPathStore_Notify_SkipsNilUUIDs(t *testing.T) {
174 t.Parallel()
175
176 ps := agentgit.NewPathStore()
177 chatID := uuid.New()
178
179 ch, unsub := ps.Subscribe(chatID)
180 defer unsub()
181
182 ps.Notify([]uuid.UUID{uuid.Nil})
183
184 // Notify sends synchronously via a non-blocking send to the
185 // buffered channel, so if a notification were going to arrive
186 // it would already be in the channel by now.
187 select {
188 case <-ch:
189 t.Fatal("received notification for nil UUID")
190 default:
191 // Expected: no notification.
192 }
193
194 require.Nil(t, ps.GetPaths(chatID))
195}
196
197func TestPathStore_Notify_AncestorNotification(t *testing.T) {
198 t.Parallel()

Callers

nothing calls this directly

Calls 6

SubscribeMethod · 0.95
NotifyMethod · 0.95
GetPathsMethod · 0.95
NewPathStoreFunction · 0.92
FatalMethod · 0.80
NewMethod · 0.65

Tested by

no test coverage detected