mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 19:02:28 +00:00
vm: implement ISNULL opcode
This commit is contained in:
parent
3db030bbb6
commit
f7f48d0048
3 changed files with 22 additions and 0 deletions
|
@ -206,6 +206,22 @@ func TestPUSHNULL(t *testing.T) {
|
|||
require.True(t, v.estack.Pop().Bool())
|
||||
}
|
||||
|
||||
func TestISNULL(t *testing.T) {
|
||||
t.Run("Integer", func(t *testing.T) {
|
||||
prog := makeProgram(opcode.PUSH1, opcode.ISNULL)
|
||||
v := load(prog)
|
||||
runVM(t, v)
|
||||
require.False(t, v.estack.Pop().Bool())
|
||||
})
|
||||
|
||||
t.Run("Null", func(t *testing.T) {
|
||||
prog := makeProgram(opcode.PUSHNULL, opcode.ISNULL)
|
||||
v := load(prog)
|
||||
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