vm: implement Pointer stack item
Pointer is a generic address type in VM. It is used for calling lambda-expressions.
This commit is contained in:
parent
b83ee77698
commit
7fcd537b09
3 changed files with 118 additions and 1 deletions
|
@ -266,6 +266,7 @@ func TestCONVERT(t *testing.T) {
|
|||
NewArrayItem(arr), NewArrayItem(nil),
|
||||
NewStructItem(arr), NewStructItem(nil),
|
||||
NewMapItem(), m, NewInteropItem(struct{}{}),
|
||||
NewPointerItem(0, []byte{}),
|
||||
}
|
||||
for i := range trueCases {
|
||||
t.Run(getName(trueCases[i], BooleanT), testBool(trueCases[i], NewBoolItem(true)))
|
||||
|
@ -329,9 +330,12 @@ func TestCONVERT(t *testing.T) {
|
|||
|
||||
t.Run("Map->Map", testCONVERT(MapT, m, m))
|
||||
|
||||
ptr := NewPointerItem(1, []byte{1})
|
||||
t.Run("Pointer->Pointer", testCONVERT(PointerT, ptr, ptr))
|
||||
|
||||
t.Run("Null->", func(t *testing.T) {
|
||||
types := []StackItemType{
|
||||
BooleanT, ByteArrayT, IntegerT, ArrayT, StructT, MapT, InteropT,
|
||||
BooleanT, ByteArrayT, IntegerT, ArrayT, StructT, MapT, InteropT, PointerT,
|
||||
}
|
||||
for i := range types {
|
||||
t.Run(types[i].String(), testCONVERT(types[i], NullItem{}, NullItem{}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue