vm: implement CLEAR opcode
This commit is contained in:
parent
525527f750
commit
c8a1188ee1
4 changed files with 94 additions and 80 deletions
|
@ -1700,6 +1700,15 @@ func TestXDROPgood(t *testing.T) {
|
|||
assert.Equal(t, int64(1), vm.estack.Peek(1).BigInt().Int64())
|
||||
}
|
||||
|
||||
func TestCLEAR(t *testing.T) {
|
||||
prog := makeProgram(opcode.CLEAR)
|
||||
v := load(prog)
|
||||
v.estack.PushVal(123)
|
||||
require.Equal(t, 1, v.estack.Len())
|
||||
require.NoError(t, v.Run())
|
||||
require.Equal(t, 0, v.estack.Len())
|
||||
}
|
||||
|
||||
func TestINVERTbadNoitem(t *testing.T) {
|
||||
prog := makeProgram(opcode.INVERT)
|
||||
runWithArgs(t, prog, nil)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue