mirror of
https://github.com/mnaberez/py65.git
synced 2025-01-17 10:30:19 +00:00
Fix breakpoint number displayed in add_breakpoint
This commit is contained in:
parent
442501f338
commit
f5668891b8
@ -767,7 +767,7 @@ class Monitor(cmd.Cmd):
|
||||
else:
|
||||
self._breakpoints.append(address)
|
||||
msg = "Breakpoint %d added at $%04X"
|
||||
self._output(msg % (len(self._breakpoints), address))
|
||||
self._output(msg % (len(self._breakpoints) - 1, address))
|
||||
|
||||
def help_add_breakpoint(self):
|
||||
self._output("add_breakpoint <address|label>")
|
||||
|
@ -66,16 +66,17 @@ class MonitorTests(unittest.TestCase):
|
||||
mon = Monitor(stdout=stdout)
|
||||
mon.do_add_breakpoint('ffd2')
|
||||
out = stdout.getvalue()
|
||||
address_parser = mon._address_parser
|
||||
self.assertTrue(out.startswith("Breakpoint 0 added at $FFD2"))
|
||||
self.assertTrue(0xffd2 in mon._breakpoints)
|
||||
|
||||
def test_do_add_breakpoint_adds_number(self):
|
||||
def test_do_add_breakpoint_adds_label(self):
|
||||
stdout = StringIO()
|
||||
mon = Monitor(stdout=stdout)
|
||||
address_parser = mon._address_parser
|
||||
address_parser.labels['chrout'] = 0xffd2
|
||||
mon.do_add_breakpoint('chrout')
|
||||
out = stdout.getvalue()
|
||||
self.assertTrue(out.startswith("Breakpoint 0 added at $FFD2"))
|
||||
self.assertTrue(0xffd2 in mon._breakpoints)
|
||||
|
||||
# add_label
|
||||
|
Loading…
x
Reference in New Issue
Block a user