mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-27 13:58:05 +00:00
783f5ecb01
closes #912
22 lines
464 B
Go
22 lines
464 B
Go
package vm
|
|
|
|
import (
|
|
"math/big"
|
|
"testing"
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestSlot_Get(t *testing.T) {
|
|
s := newSlot(3, newRefCounter())
|
|
require.NotNil(t, s)
|
|
require.Equal(t, 3, s.Size())
|
|
|
|
// Null is the default
|
|
item := s.Get(2)
|
|
require.Equal(t, stackitem.Null{}, item)
|
|
|
|
s.Set(1, stackitem.NewBigInteger(big.NewInt(42)))
|
|
require.Equal(t, stackitem.NewBigInteger(big.NewInt(42)), s.Get(1))
|
|
}
|