MCPcopy Create free account
hub / github.com/DNAProject/DNA / TestFlowControl

Function TestFlowControl

vm/neovm/stack_opcode_test.go:411–419  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

409}
410
411func TestFlowControl(t *testing.T) {
412 checkMultiStackOpCode(t, []OpCode{PUSH3, DCALL, PUSH0, PUSH1, RET}, nil, []Value{1, 0, 1})
413 checkMultiOpCode(t, []byte{byte(CALL), byte(0x03), byte(0x00), byte(PUSH2), byte(RET)}, nil, []Value{2, 2})
414 checkMultiOpCode(t, []byte{byte(JMP), byte(0x03), byte(0x00), byte(PUSH2), byte(RET)}, nil, []Value{2})
415 checkMultiOpCode(t, []byte{byte(JMPIF), byte(0x03), byte(0x00), byte(PUSH2), byte(RET)}, []Value{true}, []Value{2})
416 checkMultiOpCode(t, []byte{byte(JMPIF), byte(0x04), byte(0x00), byte(PUSH2), byte(PUSH14), byte(RET)}, []Value{true}, []Value{14})
417 checkMultiOpCode(t, []byte{byte(JMPIFNOT), byte(0x03), byte(0x00), byte(PUSH2), byte(RET)}, []Value{true}, []Value{2})
418 checkMultiOpCode(t, []byte{byte(JMPIFNOT), byte(0x04), byte(0x00), byte(PUSH2), byte(PUSH1), byte(RET)}, []Value{true}, []Value{2, 1})
419}
420
421func TestPushData(t *testing.T) {
422 checkMultiOpCode(t, []byte{byte(PUSHDATA1), byte(1), byte(2)}, nil, []Value{2})

Callers

nothing calls this directly

Calls 2

checkMultiStackOpCodeFunction · 0.85
checkMultiOpCodeFunction · 0.85

Tested by

no test coverage detected