mirror of
https://github.com/mnaberez/py65.git
synced 2025-01-04 01:30:18 +00:00
Add tests for disassemble
This commit is contained in:
parent
1a6b3fd5a9
commit
2da902cf7b
@ -260,6 +260,29 @@ class MonitorTests(unittest.TestCase):
|
||||
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):
|
||||
|
Loading…
Reference in New Issue
Block a user