(t *testing.T)
| 119 | } |
| 120 | |
| 121 | func TestParseEnvelopeItems_HeaderOnly(t *testing.T) { |
| 122 | body := []byte(`{"event_id":"only-header"}`) |
| 123 | header, items, err := parseEnvelopeItems(body) |
| 124 | if err != nil { |
| 125 | t.Fatal(err) |
| 126 | } |
| 127 | if header.EventID != "only-header" { |
| 128 | t.Errorf("header.EventID = %q", header.EventID) |
| 129 | } |
| 130 | if len(items) != 0 { |
| 131 | t.Errorf("items = %d, want 0", len(items)) |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | func TestParseEnvelopeItems_LengthBeyondBody_FallsBackToNewline(t *testing.T) { |
| 136 | // length declares more bytes than the body has — the parser must fall back |
nothing calls this directly
no test coverage detected