From fec9114caaa7d274e524793d5eb0cf2ef2c5af11 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 26 Feb 2026 15:41:45 -0800 Subject: feat: Apply Iku formatting --- internal/ingest/client_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'internal/ingest/client_test.go') 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") } -- cgit v1.2.3