Add Result stack len check in simple run test
This commit is contained in:
BlockChainDev 2019-03-18 21:15:40 +00:00
parent da27c2b3f0
commit 8809be183e

View file

@ -86,6 +86,9 @@ func TestSimpleRun(t *testing.T) {
_, err := vm.Run()
assert.Nil(t, err)
// ResultStack should be nil
assert.Equal(t, -1, vm.ResultStack.Len())
}
// returns true if the value at the top of the evaluation stack is a integer
@ -108,8 +111,7 @@ func peakTopEstack(t *testing.T, vm *VM) stack.Item {
return item
}
// returns true if the total number of items on the evaluation stack
// is equal to value
// returns true if the total number of items on the evaluation stack is equal to value
func EstackLen(t *testing.T, vm *VM, value int) bool {
ctx, err := vm.InvocationStack.CurrentContext()
assert.Nil(t, err)