(t *testing.T, result *sync.ImportResult, summary importSummary, quietMode bool)
| 729 | } |
| 730 | |
| 731 | func capturePrintImportTable(t *testing.T, result *sync.ImportResult, summary importSummary, quietMode bool) string { |
| 732 | t.Helper() |
| 733 | |
| 734 | oldStdout := os.Stdout |
| 735 | r, w, _ := os.Pipe() |
| 736 | os.Stdout = w |
| 737 | |
| 738 | err := printImportTable(result, summary, quietMode) |
| 739 | w.Close() |
| 740 | os.Stdout = oldStdout |
| 741 | |
| 742 | if err != nil { |
| 743 | t.Fatalf("printImportTable failed: %v", err) |
| 744 | } |
| 745 | |
| 746 | var buf bytes.Buffer |
| 747 | buf.ReadFrom(r) |
| 748 | return buf.String() |
| 749 | } |
| 750 | |
| 751 | func TestPrintImportTable_QuietMode(t *testing.T) { |
| 752 | result := &sync.ImportResult{ |
no test coverage detected