MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / TestPrintTable

Function TestPrintTable

internal/cli/cli_helpers_test.go:108–124  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

106}
107
108func TestPrintTable(t *testing.T) {
109 headers := []string{"NAME", "STATUS"}
110 rows := [][]string{
111 {"pve01", "online"},
112 {"pve02", "offline"},
113 }
114
115 got := captureStdout(t, func() {
116 printTable(headers, rows)
117 })
118
119 for _, want := range []string{"NAME", "STATUS", "pve01", "online", "pve02", "offline"} {
120 if !strings.Contains(got, want) {
121 t.Errorf("output missing %q\nfull output:\n%s", want, got)
122 }
123 }
124}
125
126func TestFormatBytes(t *testing.T) {
127 cases := []struct {

Callers

nothing calls this directly

Calls 2

captureStdoutFunction · 0.85
printTableFunction · 0.85

Tested by

no test coverage detected