mirror of https://github.com/docker/docs.git
Hotfix: make sure ./utils tests pass
This commit is contained in:
parent
f9e4ef5eb0
commit
1004d57b85
|
@ -5,6 +5,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -264,14 +265,16 @@ func TestCompareKernelVersion(t *testing.T) {
|
||||||
|
|
||||||
func TestHumanSize(t *testing.T) {
|
func TestHumanSize(t *testing.T) {
|
||||||
|
|
||||||
size1000 := HumanSize(1000)
|
size := strings.Trim(HumanSize(1000), " \t")
|
||||||
if size1000 != " 1 kB" {
|
expect := "1 kB"
|
||||||
t.Errorf("1000 -> expected 1 kB, got %s", size1000)
|
if size != expect {
|
||||||
|
t.Errorf("1000 -> expected '%s', got '%s'", expect, size)
|
||||||
}
|
}
|
||||||
|
|
||||||
size1024 := HumanSize(1024)
|
size = strings.Trim(HumanSize(1024), " \t")
|
||||||
if size1024 != "1.024 kB" {
|
expect = "1.024 kB"
|
||||||
t.Errorf("1024 -> expected 1.024 kB, got %s", size1024)
|
if size != expect {
|
||||||
|
t.Errorf("1024 -> expected '%s', got '%s'", expect, size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue