(t *testing.T)
| 750 | } |
| 751 | |
| 752 | func TestNewJSONOperationOutputNormalizesResults(t *testing.T) { |
| 753 | got := newJSONOperationOutput(nil, nil, nil) |
| 754 | |
| 755 | encoded, err := json.Marshal(got) |
| 756 | if err != nil { |
| 757 | t.Fatalf("marshal operation output: %v", err) |
| 758 | } |
| 759 | if !strings.Contains(string(encoded), `"results":[]`) { |
| 760 | t.Fatalf("encoded output = %s, want results array", encoded) |
| 761 | } |
| 762 | if !strings.Contains(string(encoded), `"input":{}`) { |
| 763 | t.Fatalf("encoded output = %s, want input object", encoded) |
| 764 | } |
| 765 | if got.Results == nil { |
| 766 | t.Fatal("results is nil, want empty slice") |
| 767 | } |
| 768 | } |
| 769 | |
| 770 | func TestRenderJSONOperationOutput(t *testing.T) { |
| 771 | var stdout bytes.Buffer |
nothing calls this directly
no test coverage detected