Merge pull request #746 from nspcc-dev/fix/equal

vm: implement EQUAL opcode properly

Fixes #745, #749.
This commit is contained in:
Roman Khimov 2020-03-12 11:46:51 +03:00 committed by GitHub
commit 1b5dd53e07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 157 additions and 27 deletions

View file

@ -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)