1
0
mirror of https://github.com/mnaberez/py65.git synced 2024-06-01 18:41:32 +00:00

Add test for stopping at breakpoint

This commit is contained in:
Mike Naberezny 2014-12-13 19:37:02 -08:00
parent 9695c5aa17
commit 56cee6fbbd

View File

@ -458,6 +458,16 @@ class MonitorTests(unittest.TestCase):
out = stdout.getvalue()
self.assertTrue("goto <address>" in out)
def test_goto_stops_execution_at_breakpoint(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon._address_parser.breakpoints = [ 0x02 ]
mon._mpu.memory = [ 0xEA, 0xEA, 0xEA, 0xEA ]
mon.do_goto('0')
out = stdout.getvalue()
self.assertTrue(out.startswith("Breakpoint 0 reached"))
self.assertEqual(0x02, mon._mpu.pc)
# help
def test_help_without_args_shows_documented_commands(self):