(t *testing.T)
| 164 | } |
| 165 | |
| 166 | func TestRevsJSONErrorWritesNoOutput(t *testing.T) { |
| 167 | cmd, stdout := testRevsCmd() |
| 168 | setRevsOutputJSON(t, cmd) |
| 169 | |
| 170 | stubFilesClient(t, &mockFilesClient{ |
| 171 | listRevisionsFn: func(arg *files.ListRevisionsArg) (*files.ListRevisionsResult, error) { |
| 172 | return nil, fmt.Errorf("revs failed") |
| 173 | }, |
| 174 | }) |
| 175 | |
| 176 | if err := revs(cmd, []string{"/report.pdf"}); err == nil { |
| 177 | t.Fatal("expected revs error") |
| 178 | } |
| 179 | if got := stdout.String(); got != "" { |
| 180 | t.Fatalf("stdout = %q, want empty output on error", got) |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | func TestRevsRejectsInvalidListOptions(t *testing.T) { |
| 185 | tests := []struct { |
nothing calls this directly
no test coverage detected