Hi, yes, that works much better, and I've definitely understood!
Now, about the tests, how large would you like them to be? For instance :
code = bytes (
chr(opmap["JUMP_FORWARD"]) + chr(0) + chr(255) +
chr(EXTENDED_ARG) + chr(1) + chr(1) +
chr(opmap["JUMP_FORWARD"]) + chr(0) + chr(0) +
chr(EXTENDED_ARG) + chr(1) + chr(0) +
chr(opmap["JUMP_ABSOLUTE"]) + chr(0) + chr(1) +
chr(opmap["RETURN_VALUE"]),
encoding="latin-1"
)
Would return [65283, 16842761, 65792]
And I'll make sure I test all the jump instances (I'm shuddering to imagine what a real computer would do if fed with those byte codes)
Do you want the tests to be large? (array size > 10^2/2 as a result), or is the example above fine, if I add three or four more example testing each jump instance? |