Exemplo n.º 1
0
 @Test
 public void testStore() throws StackRuntimeException {
   List<Instruction> instructions = new ArrayList<Instruction>();
   instructions.add(new Instruction("const", new IntStackValue(2)));
   instructions.add(new Instruction("store", new IntStackValue(0)));
   StackMachine machine = new StackMachine(instructions);
   machine.step();
   machine.step();
   assertEquals(new Integer(2), machine.getStore(0).getValue());
 }