(t *testing.T)
| 124 | } |
| 125 | |
| 126 | func 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 | |
| 147 | func TestFormatUptime(t *testing.T) { |
| 148 | cases := []struct { |
nothing calls this directly
no test coverage detected