MCPcopy Index your code
hub / github.com/pterm/pterm / TestBarChartPrinter_RenderExampleHorizontal

Function TestBarChartPrinter_RenderExampleHorizontal

barchart_test.go:151–179  ·  view source on GitHub ↗

HORIZONTAL bars + MIXED values test

(t *testing.T)

Source from the content-addressed store, hash-verified

149
150// HORIZONTAL bars + MIXED values test
151func TestBarChartPrinter_RenderExampleHorizontal(t *testing.T) {
152 pterm.DefaultBarChart.WithShowValue().WithHorizontal().WithBars(pterm.Bars{
153 pterm.Bar{
154 Label: "Test",
155 Value: 1337,
156 Style: pterm.NewStyle(pterm.FgRed, pterm.BgBlue, pterm.Bold),
157 },
158 pterm.Bar{
159 Label: "Test",
160 Value: 1000,
161 Style: pterm.NewStyle(pterm.FgRed, pterm.BgBlue, pterm.Bold),
162 },
163 pterm.Bar{
164 Label: "Zero",
165 Value: 0,
166 Style: pterm.NewStyle(pterm.FgRed, pterm.BgBlue, pterm.Bold),
167 },
168 pterm.Bar{
169 Label: "Test",
170 Value: -800,
171 Style: pterm.NewStyle(pterm.FgRed, pterm.BgBlue, pterm.Bold),
172 },
173 pterm.Bar{
174 Label: "Test",
175 Value: -500,
176 Style: pterm.NewStyle(pterm.FgRed, pterm.BgBlue, pterm.Bold),
177 },
178 }).Render()
179}
180
181// HORIZONTAL bars + NEGATIVE values test
182func TestBarChartPrinter_RenderNegativeBarValuesHorizontal(t *testing.T) {

Callers

nothing calls this directly

Calls 5

NewStyleFunction · 0.92
WithBarsMethod · 0.80
WithHorizontalMethod · 0.80
WithShowValueMethod · 0.80
RenderMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…