diff options
| author | Fuwn <[email protected]> | 2026-02-26 15:41:45 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-26 15:41:45 -0800 |
| commit | fec9114caaa7d274e524793d5eb0cf2ef2c5af11 (patch) | |
| tree | 0897394ccdfaf6633e1a4ca8eb02bff49bb93c00 /internal/ingest/client_test.go | |
| parent | feat: add read-only PLC API compatibility endpoints (diff) | |
| download | plutia-test-fec9114caaa7d274e524793d5eb0cf2ef2c5af11.tar.xz plutia-test-fec9114caaa7d274e524793d5eb0cf2ef2c5af11.zip | |
feat: Apply Iku formatting
Diffstat (limited to 'internal/ingest/client_test.go')
| -rw-r--r-- | internal/ingest/client_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/ingest/client_test.go b/internal/ingest/client_test.go index ff80225..50595ec 100644 --- a/internal/ingest/client_test.go +++ b/internal/ingest/client_test.go @@ -11,14 +11,16 @@ func TestDecodeExportBody_IgnoresTrailingPartialNDJSONLine(t *testing.T) { `{"seq":2,"did":"did:plc:bob","cid":"cid2","operation":{"x":2}}`, `{"seq":3,"did":"did:plc:carol","cid":"cid3","operation":{"x":3}`, }, "\n") - records, err := decodeExportBody(strings.NewReader(body), 0) + if err != nil { t.Fatalf("decode export body: %v", err) } + if len(records) != 2 { t.Fatalf("record count mismatch: got %d want 2", len(records)) } + if records[0].Seq != 1 || records[1].Seq != 2 { t.Fatalf("unexpected sequences: got [%d %d], want [1 2]", records[0].Seq, records[1].Seq) } @@ -30,8 +32,8 @@ func TestDecodeExportBody_FailsOnMalformedNonTrailingNDJSONLine(t *testing.T) { `{"seq":2,"did":"did:plc:bob","cid":"cid2","operation":{"x":2}`, `{"seq":3,"did":"did:plc:carol","cid":"cid3","operation":{"x":3}}`, }, "\n") - _, err := decodeExportBody(strings.NewReader(body), 0) + if err == nil { t.Fatalf("expected malformed middle line to fail") } |