MCPcopy Create free account
hub / github.com/driangle/taskmd / TestPrintImportTable_WithErrors

Function TestPrintImportTable_WithErrors

apps/cli/internal/cli/importcmd_test.go:804–823  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

802}
803
804func 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
825func TestPrintImportTable_Summary(t *testing.T) {
826 result := &sync.ImportResult{

Callers

nothing calls this directly

Calls 2

capturePrintImportTableFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected