(t *testing.T)
| 188 | } |
| 189 | |
| 190 | func TestRenderJSON(t *testing.T) { |
| 191 | type row struct { |
| 192 | Slug string `json:"slug"` |
| 193 | Status string `json:"status"` |
| 194 | } |
| 195 | rows := []row{{"a", "in-progress"}, {"b", "backlog"}} |
| 196 | var buf bytes.Buffer |
| 197 | if err := RenderJSON(&buf, rows); err != nil { |
| 198 | t.Fatalf("RenderJSON: %v", err) |
| 199 | } |
| 200 | out := buf.String() |
| 201 | if !strings.Contains(out, `"slug": "a"`) || !strings.Contains(out, `"status": "backlog"`) { |
| 202 | t.Errorf("RenderJSON output unexpected: %s", out) |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | func TestRenderTSV(t *testing.T) { |
| 207 | var buf bytes.Buffer |
nothing calls this directly
no test coverage detected