(t *testing.T)
| 823 | } |
| 824 | |
| 825 | func TestPrintImportTable_Summary(t *testing.T) { |
| 826 | result := &sync.ImportResult{ |
| 827 | Created: []sync.ImportAction{ |
| 828 | {ExternalID: "1", LocalID: "001", Title: "Created"}, |
| 829 | }, |
| 830 | Skipped: []sync.ImportAction{ |
| 831 | {ExternalID: "2", Title: "Skipped"}, |
| 832 | }, |
| 833 | Errors: []sync.SyncError{ |
| 834 | {ExternalID: "3", Title: "Error", Err: fmt.Errorf("fail")}, |
| 835 | }, |
| 836 | } |
| 837 | summary := importSummary{Total: 3, Created: 1, Skipped: 1, Errors: 1} |
| 838 | |
| 839 | output := capturePrintImportTable(t, result, summary, false) |
| 840 | |
| 841 | if !strings.Contains(output, "Done: 3 total, 1 created, 1 skipped, 1 errors") { |
| 842 | t.Errorf("expected summary line, got %q", output) |
| 843 | } |
| 844 | } |
nothing calls this directly
no test coverage detected