(t *testing.T, name string, fixture json.RawMessage)
| 668 | } |
| 669 | |
| 670 | func assertGoldenErrorOutputShape(t *testing.T, name string, fixture json.RawMessage) { |
| 671 | t.Helper() |
| 672 | |
| 673 | var got jsonErrorResponse |
| 674 | if err := json.Unmarshal(fixture, &got); err != nil { |
| 675 | t.Fatalf("decode golden error output for %q: %v", name, err) |
| 676 | } |
| 677 | if got.OK { |
| 678 | t.Errorf("golden error output for %q has ok=true", name) |
| 679 | } |
| 680 | if got.SchemaVersion != jsonSchemaVersion { |
| 681 | t.Errorf("golden error output for %q schema_version = %q, want %q", name, got.SchemaVersion, jsonSchemaVersion) |
| 682 | } |
| 683 | if got.Command == "" { |
| 684 | t.Errorf("golden error output for %q has empty command", name) |
| 685 | } |
| 686 | if got.Error.Message == "" { |
| 687 | t.Errorf("golden error output for %q has empty error.message", name) |
| 688 | } |
| 689 | if got.Error.Code == "" { |
| 690 | t.Errorf("golden error output for %q has empty error.code", name) |
| 691 | } |
| 692 | if got.Warnings == nil { |
| 693 | t.Errorf("golden error output for %q has nil warnings; want [] when empty", name) |
| 694 | } |
| 695 | } |
| 696 | |
| 697 | func jsonGoldenSuccessOutputExamples() map[string]jsonOperationOutput { |
| 698 | file := sampleJSONFileMetadata("/Reports/old.pdf") |
no outgoing calls
no test coverage detected