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

Function TestInits

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

Source from the content-addressed store, hash-verified

67}
68
69func TestInits(t *testing.T) {
70 i1 := NewInt64(int64(65500), big.NewInt(65535))
71 i2 := NewInt(&i1.V, i1.M)
72 assert.True(t, i1.Equal(i2))
73 b, _ := i1.MarshalBinary()
74 i3 := NewIntBytes(b, i1.M, BigEndian)
75 assert.True(t, i1.Equal(i3))
76 i4 := NewIntString(i1.String(), "", 16, i1.M)
77 assert.True(t, i1.Equal(i4))
78}
79
80func TestIntClone(t *testing.T) {
81 moduloI := new(big.Int).SetBytes([]byte{0x10, 0})

Callers

nothing calls this directly

Calls 7

NewInt64Function · 0.85
NewIntFunction · 0.85
NewIntBytesFunction · 0.85
NewIntStringFunction · 0.85
EqualMethod · 0.45
MarshalBinaryMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected