chore: refresh gramsrv public release
This commit is contained in:
parent
75cebe8dbf
commit
70b6820474
1274 changed files with 378751 additions and 59919 deletions
30
internal/rpc/update_peer_refs_test.go
Normal file
30
internal/rpc/update_peer_refs_test.go
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package rpc
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"telesrv/internal/domain"
|
||||
)
|
||||
|
||||
func TestRemoveKnownChannelRefs(t *testing.T) {
|
||||
refs := map[int64]struct{}{
|
||||
1001: {},
|
||||
1002: {},
|
||||
1003: {},
|
||||
}
|
||||
|
||||
removeKnownChannelRefs(refs, []domain.Channel{
|
||||
{ID: 1002},
|
||||
{ID: 0},
|
||||
{ID: 1004},
|
||||
})
|
||||
|
||||
if _, ok := refs[1002]; ok {
|
||||
t.Fatalf("known channel ref was not removed: %+v", refs)
|
||||
}
|
||||
for _, id := range []int64{1001, 1003} {
|
||||
if _, ok := refs[id]; !ok {
|
||||
t.Fatalf("unexpectedly removed channel %d from refs %+v", id, refs)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue