vm: implement PUSHNULL opcode
This commit is contained in:
parent
e50b529631
commit
3db030bbb6
3 changed files with 13 additions and 0 deletions
|
@ -197,6 +197,15 @@ func TestStackLimitPUSH1Bad(t *testing.T) {
|
|||
checkVMFailed(t, v)
|
||||
}
|
||||
|
||||
func TestPUSHNULL(t *testing.T) {
|
||||
prog := makeProgram(opcode.PUSHNULL, opcode.PUSHNULL, opcode.EQUAL)
|
||||
v := load(prog)
|
||||
require.NoError(t, v.Step())
|
||||
require.Equal(t, 1, v.estack.Len())
|
||||
runVM(t, v)
|
||||
require.True(t, v.estack.Pop().Bool())
|
||||
}
|
||||
|
||||
// appendBigStruct returns a program which:
|
||||
// 1. pushes size Structs on stack
|
||||
// 2. packs them into a new struct
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue