perf: sync protocol and core hardening updates
This commit is contained in:
parent
152fed3b87
commit
4390ebf5a9
283 changed files with 29231 additions and 2295 deletions
22
internal/store/memory/channel_recovery_test.go
Normal file
22
internal/store/memory/channel_recovery_test.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package memory
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMaxChannelPtsBatchUsesOneSnapshotAndOmitsMissing(t *testing.T) {
|
||||
channels := NewChannelStore()
|
||||
channels.mu.Lock()
|
||||
channels.ptsSeq[10] = 7
|
||||
channels.ptsSeq[20] = 11
|
||||
channels.mu.Unlock()
|
||||
|
||||
got, err := channels.MaxChannelPtsBatch(context.Background(), []int64{20, 999, 10, 20})
|
||||
if err != nil {
|
||||
t.Fatalf("MaxChannelPtsBatch: %v", err)
|
||||
}
|
||||
if len(got) != 2 || got[10] != 7 || got[20] != 11 {
|
||||
t.Fatalf("batch pts = %v, want map[10:7 20:11] with missing id omitted", got)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue