mirror of
https://github.com/mnaberez/py65.git
synced 2024-10-04 09:57:28 +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'}
|
'z': 'step'}
|
||||||
|
|
||||||
def _preprocess_line(self, line):
|
def _preprocess_line(self, line):
|
||||||
|
# ignore leading dots
|
||||||
|
while line.startswith('.'):
|
||||||
|
line = line[1:]
|
||||||
|
|
||||||
# command shortcuts
|
# command shortcuts
|
||||||
for shortcut, command in self._shortcuts.iteritems():
|
for shortcut, command in self._shortcuts.iteritems():
|
||||||
pattern = '^%s\s+' % re.escape(shortcut)
|
pattern = '^%s\s+' % re.escape(shortcut)
|
||||||
|
@ -7,6 +7,16 @@ from StringIO import StringIO
|
|||||||
|
|
||||||
class MonitorTests(unittest.TestCase):
|
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
|
# assemble
|
||||||
|
|
||||||
def test_do_assemble_assembles_valid_statement(self):
|
def test_do_assemble_assembles_valid_statement(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user