Example #1
0
 def test_strips(self):
     self.assertEqual(parser('  mov rax, 20  '), ['mov', 'rax', '20'])
Example #2
0
 def test_invalid_argument_size(self):
     with self.assertRaises(InstructionNotFound):
         branch_instruction(parser('add rax, rbx, rcx'))
     with self.assertRaises(InstructionNotFound):
         branch_instruction(parser('add rax'))
Example #3
0
 def test_no_command(self):
     with self.assertRaises(InstructionNotFound):
         branch_instruction(parser('BadCommand'))
Example #4
0
 def test_one_word_commands(self):
     self.assertEqual(parser('cpuid'), ['cpuid'])
Example #5
0
 def test_capital(self):
     self.assertEqual(parser('  MOV RDX, 0x17  '), ['mov', 'rdx', '0x17'])
Example #6
0
 def test_space_in_arguments(self):
     self.assertEqual(parser('  mov r ax, 2 0  '), ['mov', 'r ax', '2 0'])