Skip to content

Commit

Permalink
fix unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
zc committed Mar 30, 2020
1 parent 892377e commit e8e718c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions types/helper_test.go
Expand Up @@ -17,9 +17,9 @@ func TestRound(t *testing.T) {
a = 0.1999998
assert.Equal(t, f(Round(a)), "0.2")
a = 1.999998
assert.Equal(t, f(Round(a)), "2")
assert.Equal(t, f(Round(a)), "1.999998")
a = 19.99998
assert.Equal(t, f(Round(a)), "20")
assert.Equal(t, f(Round(a)), "19.99998")
}

func TestHookOutput(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions types/volume_test.go
Expand Up @@ -85,6 +85,7 @@ func TestVolumeBindings(t *testing.T) {
vbs, _ := MakeVolumeBindings([]string{"/1:/dst:rw:1000", "/0:/dst:rom"})
assert.Equal(t, vbs.ToStringSlice(false, false), []string{"/1:/dst:rw:1000", "/0:/dst:rom:0"})
assert.Equal(t, vbs.ToStringSlice(true, false), []string{"/0:/dst:rom:0", "/1:/dst:rw:1000"})
assert.Equal(t, vbs.AdditionalStorage(), int64(1000))
assert.Equal(t, vbs.TotalSize(), int64(1000))

vbs1, _ := MakeVolumeBindings([]string{"AUTO:/data0:rw:1", "AUTO:/data1:rw:2", "/mnt1:/data2:rw", "/mnt2:/data3:ro"})
Expand Down
4 changes: 2 additions & 2 deletions utils/utils_test.go
Expand Up @@ -183,9 +183,9 @@ func TestRound(t *testing.T) {
a = 0.1999998
assert.Equal(t, f(Round(a)), "0.2")
a = 1.999998
assert.Equal(t, f(Round(a)), "2")
assert.Equal(t, f(Round(a)), "1.999998")
a = 19.99998
assert.Equal(t, f(Round(a)), "20")
assert.Equal(t, f(Round(a)), "19.99998")
}

func TestMin(t *testing.T) {
Expand Down

0 comments on commit e8e718c

Please sign in to comment.