-
Notifications
You must be signed in to change notification settings - Fork 1
/
int64_64b_test.go
45 lines (32 loc) · 1.16 KB
/
int64_64b_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//go:build amd64 || arm64
// +build amd64 arm64
package as_test
import (
"math"
"testing"
"github.com/lunemec/as"
)
func TestInt64(t *testing.T) {
assertNoError(t, as.Int64, int8(math.MinInt8))
assertNoError(t, as.Int64, int8(math.MaxInt8))
pointerToMaxInt8 := int8(math.MaxInt8)
assertNoError(t, as.Int, &pointerToMaxInt8)
assertNoError(t, as.Int64, int16(math.MinInt16))
assertNoError(t, as.Int64, int16(math.MaxInt16))
assertNoError(t, as.Int64, int32(math.MinInt32))
assertNoError(t, as.Int64, int32(math.MaxInt32))
assertNoError(t, as.Int64, int64(math.MinInt64))
assertNoError(t, as.Int64, int64(math.MaxInt64))
assertNoError(t, as.Int64, int(math.MinInt64))
assertNoError(t, as.Int64, int(math.MaxInt64))
assertNoError(t, as.Int64, uint8(0))
assertNoError(t, as.Int64, uint8(math.MaxUint8))
assertNoError(t, as.Int64, uint16(0))
assertNoError(t, as.Int64, uint16(math.MaxUint16))
assertNoError(t, as.Int64, uint32(0))
assertNoError(t, as.Int64, uint32(math.MaxUint32))
assertNoError(t, as.Int64, uint64(0))
assertError(t, as.Int64, uint64(math.MaxUint64))
assertNoError(t, as.Int64, uint(0))
assertError(t, as.Int64, uint(math.MaxUint64))
}