Пример #1
0
 def test_instruction_nop_01(self):
     accumulator = 0
     programCounter = 0
     state = processInstruction(('nop', 1), (programCounter, accumulator))
     self.assertEqual(state[0], 1)
     self.assertEqual(state[1], 0)
Пример #2
0
 def test_instruction_jmp_03(self):
     accumulator = 0
     programCounter = 0
     state = processInstruction(('jmp', -2), (programCounter, accumulator))
     self.assertEqual(state[0], -2)
     self.assertEqual(state[1], 0)
Пример #3
0
 def test_instruction_acc_02(self):
     accumulator = 0
     programCounter = 0
     state = processInstruction(('acc', -1), (programCounter, accumulator))
     self.assertEqual(state[0], 1)
     self.assertEqual(state[1], -1)