Merge pull request #746 from nspcc-dev/fix/equal
vm: implement EQUAL opcode properly Fixes #745, #749.
This commit is contained in:
commit
1b5dd53e07
5 changed files with 157 additions and 27 deletions
|
@ -1006,6 +1006,16 @@ func TestEQUALGoodInteger(t *testing.T) {
|
|||
assert.Equal(t, &BoolItem{true}, vm.estack.Pop().value)
|
||||
}
|
||||
|
||||
func TestEQUALIntegerByteArray(t *testing.T) {
|
||||
prog := makeProgram(opcode.EQUAL)
|
||||
vm := load(prog)
|
||||
vm.estack.PushVal([]byte{16})
|
||||
vm.estack.PushVal(16)
|
||||
runVM(t, vm)
|
||||
assert.Equal(t, 1, vm.estack.Len())
|
||||
assert.Equal(t, &BoolItem{true}, vm.estack.Pop().value)
|
||||
}
|
||||
|
||||
func TestEQUALArrayTrue(t *testing.T) {
|
||||
prog := makeProgram(opcode.DUP, opcode.EQUAL)
|
||||
vm := load(prog)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue