(t *testing.T)
| 802 | } |
| 803 | |
| 804 | func TestPrintImportTable_WithErrors(t *testing.T) { |
| 805 | result := &sync.ImportResult{ |
| 806 | Errors: []sync.SyncError{ |
| 807 | {ExternalID: "GH-9", Title: "Bad task", Err: fmt.Errorf("write failed")}, |
| 808 | }, |
| 809 | } |
| 810 | summary := importSummary{Total: 1, Errors: 1} |
| 811 | |
| 812 | output := capturePrintImportTable(t, result, summary, false) |
| 813 | |
| 814 | if !strings.Contains(output, "Errors 1 task(s)") { |
| 815 | t.Errorf("expected 'Errors 1 task(s)', got %q", output) |
| 816 | } |
| 817 | if !strings.Contains(output, "[GH-9] Bad task") { |
| 818 | t.Error("expected error task external ID and title in output") |
| 819 | } |
| 820 | if !strings.Contains(output, "write failed") { |
| 821 | t.Error("expected error message in output") |
| 822 | } |
| 823 | } |
| 824 | |
| 825 | func TestPrintImportTable_Summary(t *testing.T) { |
| 826 | result := &sync.ImportResult{ |
nothing calls this directly
no test coverage detected