コード例 #1
0
 @Test
 public void testLoad() throws StackRuntimeException {
   List<Instruction> instructions = new ArrayList<Instruction>();
   instructions.add(new Instruction("load", new IntStackValue(0)));
   StackMachine machine = new StackMachine(instructions);
   machine.setStore(0, new IntStackValue(2));
   machine.step();
   assertEquals(new Integer(2), machine.getStack().pop().getValue());
 }