(t *testing.T)
| 56 | } |
| 57 | |
| 58 | func TestTablePrinterWithRowSeparators_Render(t *testing.T) { |
| 59 | d := pterm.TableData{ |
| 60 | {"Firstname", "Lastname", "Email"}, |
| 61 | {"Paul", "Dean", "nisi.dictum.augue@velitAliquam.co.uk"}, |
| 62 | {"Callie", "Mckay", "egestas.nunc.sed@est.com"}, |
| 63 | {"Libby", "Camacho", "aliquet.lobortis@semper.com"}, |
| 64 | } |
| 65 | // WithHeaderSeparator |
| 66 | printer := pterm.DefaultTable.WithHasHeader().WithHeaderRowSeparator("=").WithData(d) |
| 67 | content, err := printer.Srender() |
| 68 | testza.AssertNoError(t, err) |
| 69 | testza.AssertNotNil(t, content) |
| 70 | // WithRowSeparator |
| 71 | printer = pterm.DefaultTable.WithHasHeader().WithRowSeparator("-").WithData(d) |
| 72 | content, err = printer.Srender() |
| 73 | testza.AssertNoError(t, err) |
| 74 | testza.AssertNotNil(t, content) |
| 75 | // WithHeaderRowSeparator & WithRowSeparator |
| 76 | printer = pterm.DefaultTable.WithHasHeader().WithHeaderRowSeparator("=").WithRowSeparator("-").WithData(d) |
| 77 | content, err = printer.Srender() |
| 78 | testza.AssertNoError(t, err) |
| 79 | testza.AssertNotNil(t, content) |
| 80 | } |
| 81 | |
| 82 | func TestTablePrinter_WithCSVReader(t *testing.T) { |
| 83 | content := captureStdout(func(w io.Writer) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…