The core protocol of WoopChain
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
woop/internal/utils/metrics_test.go

19 lines
397 B

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")
}