18 lines
403 B
Go
18 lines
403 B
Go
package sizeof_test
|
|
|
|
import (
|
|
"math"
|
|
"testing"
|
|
|
|
"git.akyoto.dev/cli/q/src/sizeof"
|
|
"git.akyoto.dev/go/assert"
|
|
)
|
|
|
|
func TestUnsigned(t *testing.T) {
|
|
assert.Equal(t, sizeof.Unsigned(0), 1)
|
|
assert.Equal(t, sizeof.Unsigned(math.MaxUint8), 1)
|
|
assert.Equal(t, sizeof.Unsigned(math.MaxUint16), 2)
|
|
assert.Equal(t, sizeof.Unsigned(math.MaxUint32), 4)
|
|
assert.Equal(t, sizeof.Unsigned(math.MaxUint64), 8)
|
|
}
|