refactor(go): keep protocol realtime snapshots lightweight
This commit is contained in:
@@ -67,7 +67,7 @@ func TestRepositoryUpdatesMergedAndProtocolSnapshots(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRepositoryStoresFullParsedProtocolSnapshotAndMergesGB32960Units(t *testing.T) {
|
||||
func TestRepositoryStoresFullParsedOnlyInRealtimeRawAndMergesGB32960Units(t *testing.T) {
|
||||
repo, closeFn := newTestRepository(t)
|
||||
defer closeFn()
|
||||
ctx := context.Background()
|
||||
@@ -110,9 +110,12 @@ func TestRepositoryStoresFullParsedProtocolSnapshotAndMergesGB32960Units(t *test
|
||||
if err != nil {
|
||||
t.Fatalf("GetRealtimeRaw() error = %v", err)
|
||||
}
|
||||
units := protocol.Parsed["data_units"].([]any)
|
||||
if len(units) != 2 {
|
||||
t.Fatalf("expected merged gb32960 units, got %#v", protocol.Parsed)
|
||||
protocolJSON, err := json.Marshal(protocol)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if strings.Contains(string(protocolJSON), `"parsed"`) {
|
||||
t.Fatalf("protocol snapshot should not duplicate full parsed data: %s", string(protocolJSON))
|
||||
}
|
||||
if len(realtimeRaw["data_units"].([]any)) != 2 {
|
||||
t.Fatalf("realtime-raw did not keep merged parsed fields: %#v", realtimeRaw)
|
||||
|
||||
Reference in New Issue
Block a user