MCPcopy Create free account
hub / github.com/DOSNetwork/core / TestIntEndianBytes

Function TestIntEndianBytes

group/mod/int_test.go:56–67  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

54 assert.False(t, i.Equal(i2))
55}
56func TestIntEndianBytes(t *testing.T) {
57 modulo, err := hex.DecodeString("1000")
58 moduloI := new(big.Int).SetBytes(modulo)
59 assert.Nil(t, err)
60 v, err := hex.DecodeString("10")
61 assert.Nil(t, err)
62
63 i := new(Int).InitBytes(v, moduloI, BigEndian)
64
65 assert.Equal(t, 2, i.MarshalSize())
66 assert.NotPanics(t, func() { i.LittleEndian(2, 2) })
67}
68
69func TestInits(t *testing.T) {
70 i1 := NewInt64(int64(65500), big.NewInt(65535))

Callers

nothing calls this directly

Calls 5

InitBytesMethod · 0.80
LittleEndianMethod · 0.80
SetBytesMethod · 0.45
EqualMethod · 0.45
MarshalSizeMethod · 0.45

Tested by

no test coverage detected