| 171 | } |
| 172 | |
| 173 | func 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 | |
| 197 | func TestPathStore_Notify_AncestorNotification(t *testing.T) { |
| 198 | t.Parallel() |