feat: add MemStore Go-parity methods & 25 new tests (Task 3)
Port Go memstore sync interface: Compact, Truncate, PurgeEx, SkipMsgs, LoadNextMsg, NumPending, MultiLastSeqs, AllLastSeqs, SubjectsTotals, SubjectsState, GetSeqFromTime, NextWildcardMatch, NextLiteralMatch, MessageTTL, UpdateConfig. Fix RestoreSnapshotAsync to handle gapped sequences, update MsgSize to include subject length + 16 overhead (Go parity). 25 new tests ported from memstore_test.go.
This commit is contained in:
@@ -216,7 +216,9 @@ public sealed class MemStoreTests
|
||||
await store.AppendAsync("foo", payload, default);
|
||||
|
||||
var state = await store.GetStateAsync(default);
|
||||
state.Bytes.ShouldBe((ulong)500);
|
||||
// Go parity: MsgSize = subj.Length + hdr + data + 16 overhead
|
||||
// "foo"(3) + 100 + 16 = 119 per msg × 5 = 595
|
||||
state.Bytes.ShouldBe((ulong)595);
|
||||
}
|
||||
|
||||
// Go: TestMemStoreBytesLimit server/memstore_test.go
|
||||
@@ -233,7 +235,9 @@ public sealed class MemStoreTests
|
||||
await store.RemoveAsync(3, default);
|
||||
|
||||
var state = await store.GetStateAsync(default);
|
||||
state.Bytes.ShouldBe((ulong)300);
|
||||
// Go parity: MsgSize = subj.Length + hdr + data + 16 overhead
|
||||
// "foo"(3) + 100 + 16 = 119 per msg × 3 remaining = 357
|
||||
state.Bytes.ShouldBe((ulong)357);
|
||||
}
|
||||
|
||||
// Snapshot and restore.
|
||||
|
||||
Reference in New Issue
Block a user