1
0
mirror of https://github.com/mnaberez/py65.git synced 2024-07-03 05:29:27 +00:00

Ignore leading dots in monitor commands.

This commit is contained in:
Mike Naberezny 2009-08-20 19:04:17 -07:00
parent c33fd61b36
commit c714480580
2 changed files with 14 additions and 0 deletions

View File

@ -68,6 +68,10 @@ class Monitor(cmd.Cmd):
'z': 'step'}
def _preprocess_line(self, line):
# ignore leading dots
while line.startswith('.'):
line = line[1:]
# command shortcuts
for shortcut, command in self._shortcuts.iteritems():
pattern = '^%s\s+' % re.escape(shortcut)

View File

@ -7,6 +7,16 @@ from StringIO import StringIO
class MonitorTests(unittest.TestCase):
# line processing
def test_preprocess_line_removes_leading_dots(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon.onecmd('...help')
out = stdout.getvalue()
self.assert_('Documented commands' in out)
# assemble
def test_do_assemble_assembles_valid_statement(self):