Example #1
0
func TestInt64(t *testing.T) {
	fmt.Println("TestInt64()")
	unittest.EqualsExact(t, ToInt64([...]byte{0, 0, 0, 0, 0, 0, 0, 0}), int64(0))
	unittest.EqualsExact(t, ToInt64([...]byte{128, 0, 0, 0, 0, 0, 0, 0}), int64(MinInt64))
	unittest.EqualsExact(t, ToInt64([...]byte{127, 255, 255, 255, 255, 255, 255, 255}), int64(MaxInt64))
	unittest.EqualsExact(t, ToInt64([...]byte{255, 255, 255, 255, 255, 255, 255, 255}), int64(-1))
	unittest.EqualsExact(t, ToInt64(FromInt64(MinInt64)), int64(MinInt64))
	unittest.EqualsExact(t, ToInt64(FromInt64(MaxInt64)), int64(MaxInt64))
}
Example #2
0
func TestUInt64(t *testing.T) {
	fmt.Println("TestUInt64()")
	unittest.EqualsExact(t, ToUInt64([...]byte{0, 0, 0, 0, 0, 0, 0, 0}), uint64(0))
	unittest.EqualsExact(t, ToUInt64([...]byte{255, 255, 255, 255, 255, 255, 255, 255}), uint64(MaxUint64))
	unittest.EqualsExact(t, ToUInt64(FromUInt64(MaxUint64)), uint64(MaxUint64))
}