MCPcopy Create free account
hub / github.com/DNAProject/DNA / TestValueStack_CopyTo

Function TestValueStack_CopyTo

vm/neovm/value_stack_test.go:113–131  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

111}
112
113func TestValueStack_CopyTo(t *testing.T) {
114 r := NewValueStack(0)
115 val, err := types.VmValueFromBigInt(big.NewInt(9999))
116 assert.Equal(t, err, nil)
117 r.Push(val)
118 val2, err := types.VmValueFromBigInt(big.NewInt(8888))
119 assert.Equal(t, err, nil)
120 r.Push(val2)
121
122 e := NewValueStack(0)
123 err = r.CopyTo(e)
124 assert.Equal(t, err, nil)
125
126 for k, v := range r.data {
127 if !v.Equals(e.data[k]) {
128 t.Fatal("stack copyto test failed.")
129 }
130 }
131}

Callers

nothing calls this directly

Calls 6

PushMethod · 0.95
CopyToMethod · 0.95
VmValueFromBigIntFunction · 0.92
NewValueStackFunction · 0.85
FatalMethod · 0.80
EqualsMethod · 0.65

Tested by

no test coverage detected