MCPcopy
hub / github.com/pterm/pterm / TestTablePrinterWithAlternateStyle_Render

Function TestTablePrinterWithAlternateStyle_Render

table_printer_test.go:40–56  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

38}
39
40func TestTablePrinterWithAlternateStyle_Render(t *testing.T) {
41 d := pterm.TableData{
42 {"Firstname", "Lastname", "Email"},
43 {"Paul", "Dean", "nisi.dictum.augue@velitAliquam.co.uk"},
44 {"Callie", "Mckay", "egestas.nunc.sed@est.com"},
45 {"Libby", "Camacho", "aliquet.lobortis@semper.com"},
46 }
47
48 // Define the alternate row style
49 alternateStyle := pterm.NewStyle(pterm.BgDarkGray)
50
51 // Create a printer with the alternate row style
52 printer := pterm.DefaultTable.WithHasHeader().WithAlternateRowStyle(alternateStyle).WithData(d)
53 content, err := printer.Srender()
54 testza.AssertNoError(t, err)
55 testza.AssertNotNil(t, content)
56}
57
58func TestTablePrinterWithRowSeparators_Render(t *testing.T) {
59 d := pterm.TableData{

Callers

nothing calls this directly

Calls 5

NewStyleFunction · 0.92
WithAlternateRowStyleMethod · 0.80
WithHasHeaderMethod · 0.80
SrenderMethod · 0.65
WithDataMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…