(t *testing.T)
| 481 | } |
| 482 | |
| 483 | func TestAPIResponse_FormatJSON(t *testing.T) { |
| 484 | resp := &lib.APIResponse{ |
| 485 | Body: []byte(`{"key":"abc","name":"Test"}`), |
| 486 | } |
| 487 | formatted := resp.FormatJSON() |
| 488 | if !strings.Contains(formatted, " ") { |
| 489 | t.Error("expected pretty-printed JSON with indentation") |
| 490 | } |
| 491 | |
| 492 | var parsed map[string]interface{} |
| 493 | if err := json.Unmarshal([]byte(formatted), &parsed); err != nil { |
| 494 | t.Errorf("formatted JSON should be valid: %v", err) |
| 495 | } |
| 496 | } |
| 497 | |
| 498 | func TestAPIResponse_ParseError_ErrorField(t *testing.T) { |
| 499 | resp := &lib.APIResponse{ |
nothing calls this directly
no test coverage detected