Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
More Opcode unit tests (#135)
Browse files Browse the repository at this point in the history
* DEPTH, NIP and XDROP unit tests

* XSWAP

* SWAP

* ROT

* OVER
  • Loading branch information
shargon authored and vncoelho committed Apr 22, 2019
1 parent f7ad3bd commit 1adff44
Show file tree
Hide file tree
Showing 7 changed files with 2,005 additions and 0 deletions.
257 changes: 257 additions & 0 deletions tests/neo-vm.Tests/Tests/OpCodes/Stack/DEPTH.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
{
"category": "Stack",
"name": "DEPTH",
"tests":
[
{
"name": "Without push",
"script": "0x74",
"steps":
[
{
"actions":
[
"StepInto"
],
"result":
{
"state": "Break",
"invocationStack":
[
{
"scriptHash": "0xB1DF1979BA1AA2A8A114B641D764F26CF1D5D844",
"instructionPointer": 1,
"nextInstruction": "RET",
"evaluationStack":
[
{
"type": "Integer",
"value": 0
}
]
}
]
}
},
{
"actions":
[
"StepInto"
],
"result":
{
"state": "Halt",
"resultStack":
[
{
"type": "Integer",
"value": 0
}
]
}
}
]
},
{
"name": "With push",
"script": "0x5274",
"steps":
[
{
"actions":
[
"StepInto"
],
"result":
{
"state": "Break",
"invocationStack":
[
{
"scriptHash": "0x624FD1BC5EB834B8D0E3A0EDD8B3C9B6FFE07F1F",
"instructionPointer": 1,
"nextInstruction": "DEPTH",
"evaluationStack":
[
{
"type": "Integer",
"value": 2
}
]
}
]
}
},
{
"actions":
[
"StepInto"
],
"result":
{
"state": "Break",
"invocationStack":
[
{
"scriptHash": "0x624FD1BC5EB834B8D0E3A0EDD8B3C9B6FFE07F1F",
"instructionPointer": 2,
"nextInstruction": "RET",
"evaluationStack":
[
{
"type": "Integer",
"value": 1
},
{
"type": "Integer",
"value": 2
}
]
}
]
}
},
{
"actions":
[
"StepInto"
],
"result":
{
"state": "Halt",
"resultStack":
[
{
"type": "Integer",
"value": 1
},
{
"type": "Integer",
"value": 2
}
]
}
}
]
},
{
"name": "3xDEPTH",
"script": "0x747474",
"steps":
[
{
"actions":
[
"StepInto"
],
"result":
{
"state": "Break",
"invocationStack":
[
{
"scriptHash": "0xC53606A179DF21289AF657F6F8E0D4890A7C3238",
"instructionPointer": 1,
"nextInstruction": "DEPTH",
"evaluationStack":
[
{
"type": "Integer",
"value": 0
}
]
}
]
}
},
{
"actions":
[
"StepInto"
],
"result":
{
"state": "Break",
"invocationStack":
[
{
"scriptHash": "0xC53606A179DF21289AF657F6F8E0D4890A7C3238",
"instructionPointer": 2,
"nextInstruction": "DEPTH",
"evaluationStack":
[
{
"type": "Integer",
"value": 1
},
{
"type": "Integer",
"value": 0
}
]
}
]
}
},
{
"actions":
[
"StepInto"
],
"result":
{
"state": "Break",
"invocationStack":
[
{
"scriptHash": "0xC53606A179DF21289AF657F6F8E0D4890A7C3238",
"instructionPointer": 3,
"nextInstruction": "RET",
"evaluationStack":
[
{
"type": "Integer",
"value": 2
},
{
"type": "Integer",
"value": 1
},
{
"type": "Integer",
"value": 0
}
]
}
]
}
},
{
"actions":
[
"StepInto"
],
"result":
{
"state": "Halt",
"resultStack":
[
{
"type": "Integer",
"value": 2
},
{
"type": "Integer",
"value": 1
},
{
"type": "Integer",
"value": 0
}
]
}
}
]
}
]
}
Loading

0 comments on commit 1adff44

Please sign in to comment.