This commit is contained in:
1 parent
bca550374f
commit
f854cbace5
8 files changed
+343
-25
No files matched your search
@@ -178,26 +178,3 @@ func TestTargetNaming(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestFormatBytes(t *testing.T) {
|
||||
tests := []struct {
|
||||
size int64
|
||||
expected string
|
||||
}{
|
||||
{500, "500 B"},
|
||||
{1024, "1.0 KiB"},
|
||||
{1500, "1.5 KiB"},
|
||||
{1048576, "1.0 MiB"},
|
||||
{1572864, "1.5 MiB"},
|
||||
{1073741824, "1.0 GiB"},
|
||||
{1610612736, "1.5 GiB"},
|
||||
{1099511627776, "1.0 TiB"},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
result := formatBytes(test.size)
|
||||
if result != test.expected {
|
||||
t.Errorf("For %d bytes expected '%s', got '%s'", test.size, test.expected, result)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user