mirror of
https://github.com/mnaberez/py65.git
synced 2025-02-05 10:32:12 +00:00
Add tests for add_label
This commit is contained in:
parent
586a227b7f
commit
9695c5aa17
@ -44,6 +44,40 @@ class MonitorTests(unittest.TestCase):
|
||||
self.assertEqual("assemble lda #$';'",
|
||||
mon._preprocess_line("assemble lda #$';' ;comment"))
|
||||
|
||||
# add_breakpoint
|
||||
|
||||
def test_shortcut_for_add_breakpoint(self):
|
||||
stdout = StringIO()
|
||||
mon = Monitor(stdout=stdout)
|
||||
mon.do_help('ab')
|
||||
|
||||
out = stdout.getvalue()
|
||||
self.assertTrue(out.startswith('add_breakpoint'))
|
||||
|
||||
def test_do_add_breakpoint_syntax_error(self):
|
||||
stdout = StringIO()
|
||||
mon = Monitor(stdout=stdout)
|
||||
mon.do_add_breakpoint('')
|
||||
out = stdout.getvalue()
|
||||
self.assertTrue(out.startswith("Syntax error:"))
|
||||
|
||||
def test_do_add_breakpoint_adds_number(self):
|
||||
stdout = StringIO()
|
||||
mon = Monitor(stdout=stdout)
|
||||
mon.do_add_breakpoint('ffd2')
|
||||
out = stdout.getvalue()
|
||||
address_parser = mon._address_parser
|
||||
self.assertTrue(0xffd2 in address_parser.breakpoints)
|
||||
|
||||
def test_do_add_breakpoint_adds_number(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(0xffd2 in address_parser.breakpoints)
|
||||
|
||||
# add_label
|
||||
|
||||
def test_shortcut_for_add_label(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user