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

Function TestFormatBytes

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

Source from the content-addressed store, hash-verified

124}
125
126func TestFormatBytes(t *testing.T) {
127 cases := []struct {
128 input int64
129 want string
130 }{
131 {0, "0 B"},
132 {512, "512 B"},
133 {1024, "1.0 KiB"},
134 {1536, "1.5 KiB"},
135 {1048576, "1.0 MiB"},
136 {1073741824, "1.0 GiB"},
137 }
138
139 for _, tc := range cases {
140 got := formatBytes(tc.input)
141 if got != tc.want {
142 t.Errorf("formatBytes(%d) = %q, want %q", tc.input, got, tc.want)
143 }
144 }
145}
146
147func TestFormatUptime(t *testing.T) {
148 cases := []struct {

Callers

nothing calls this directly

Calls 1

formatBytesFunction · 0.85

Tested by

no test coverage detected