parent
99a9baf8d4
commit
0718efdcbf
@ -0,0 +1,19 @@ |
||||
package utils |
||||
|
||||
import ( |
||||
"testing" |
||||
|
||||
"github.com/stretchr/testify/assert" |
||||
) |
||||
|
||||
// Test for BToMb.
|
||||
func TestBToMb(t *testing.T) { |
||||
a := uint64(1024*1024 + 1) |
||||
assert.Equal(t, BToMb(a), uint64(1), "should be equal to 1") |
||||
|
||||
a = uint64(1024*1024 - 1) |
||||
assert.Equal(t, BToMb(a), uint64(0), "should be equal to 0") |
||||
|
||||
a = uint64(1024 * 1024) |
||||
assert.Equal(t, BToMb(a), uint64(1), "should be equal to 0") |
||||
} |
Loading…
Reference in new issue