Skip to content

Commit

Permalink
Add tests for disassemble
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaberez committed Feb 5, 2012
1 parent 1a6b3fd commit 2da902c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/py65/tests/test_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,29 @@ def test_disassemble_shows_help_when_given_extra_args(self):
out = stdout.getvalue()
self.assertTrue(out.startswith('disassemble <address_range>'))

def test_disassemble_will_disassemble_one_address(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon._mpu.memory[0xc000] = 0xEA #=> NOP
mon._mpu.step()
mon.do_disassemble("c000")

out = stdout.getvalue()
disasm = "$c000 ea NOP\n"
self.assertEqual(out, disasm)

def test_disassemble_will_disassemble_an_address_range(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon._mpu.memory[0xc000] = 0xEA #=> NOP
mon._mpu.memory[0xc001] = 0xEA #=> NOP
mon._mpu.step()
mon.do_disassemble("c000:c002")

out = stdout.getvalue()
disasm = "$c000 ea NOP\n$c001 ea NOP\n"
self.assertEqual(out, disasm)

# fill

def test_shortcut_f_for_fill(self):
Expand Down

0 comments on commit 2da902c

Please sign in to comment.