From 603fd31a74a1700d1744829b076a51b7293996d9 Mon Sep 17 00:00:00 2001 From: Mike Naberezny Date: Fri, 19 Dec 2014 21:32:12 -0800 Subject: [PATCH] Add test for run path without breakpoints --- py65/tests/test_monitor.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/py65/tests/test_monitor.py b/py65/tests/test_monitor.py index 7365e9e..8701961 100644 --- a/py65/tests/test_monitor.py +++ b/py65/tests/test_monitor.py @@ -459,14 +459,30 @@ class MonitorTests(unittest.TestCase): out = stdout.getvalue() self.assertTrue("goto
" in out) - def test_goto_stops_execution_at_breakpoint(self): + def test_goto_with_breakpoints_stops_execution_at_breakpoint(self): stdout = StringIO() mon = Monitor(stdout=stdout) - mon._breakpoints = [ 0x02 ] + mon._breakpoints = [ 0x03 ] mon._mpu.memory = [ 0xEA, 0xEA, 0xEA, 0xEA ] mon.do_goto('0') out = stdout.getvalue() self.assertTrue(out.startswith("Breakpoint 0 reached")) + self.assertEqual(0x03, mon._mpu.pc) + + def test_goto_with_breakpoints_stops_execution_at_brk(self): + stdout = StringIO() + mon = Monitor(stdout=stdout) + mon._breakpoints = [ 0x02 ] + mon._mpu.memory = [ 0xEA, 0xEA, 0x00, 0xEA ] + mon.do_goto('0') + self.assertEqual(0x02, mon._mpu.pc) + + def test_goto_without_breakpoints_stops_execution_at_brk(self): + stdout = StringIO() + mon = Monitor(stdout=stdout) + mon._breakpoints = [] + mon._mpu.memory = [ 0xEA, 0xEA, 0x00, 0xEA ] + mon.do_goto('0') self.assertEqual(0x02, mon._mpu.pc) # help