1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Hotfix: make sure ./utils tests pass

This commit is contained in:
Guillaume J. Charmes 2013-07-15 17:56:18 -07:00
parent f9e4ef5eb0
commit 1004d57b85
No known key found for this signature in database
GPG key ID: B33E4642CB6E3FF3

View file

@ -5,6 +5,7 @@ import (
"errors"
"io"
"io/ioutil"
"strings"
"testing"
)
@ -264,14 +265,16 @@ func TestCompareKernelVersion(t *testing.T) {
func TestHumanSize(t *testing.T) {
size1000 := HumanSize(1000)
if size1000 != " 1 kB" {
t.Errorf("1000 -> expected 1 kB, got %s", size1000)
size := strings.Trim(HumanSize(1000), " \t")
expect := "1 kB"
if size != expect {
t.Errorf("1000 -> expected '%s', got '%s'", expect, size)
}
size1024 := HumanSize(1024)
if size1024 != "1.024 kB" {
t.Errorf("1024 -> expected 1.024 kB, got %s", size1024)
size = strings.Trim(HumanSize(1024), " \t")
expect = "1.024 kB"
if size != expect {
t.Errorf("1024 -> expected '%s', got '%s'", expect, size)
}
}