mirror of
https://github.com/mnaberez/py65.git
synced 2024-11-18 15:06:35 +00:00
Ignore leading dots in monitor commands.
This commit is contained in:
parent
c33fd61b36
commit
c714480580
@ -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)
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user