1
0
mirror of https://github.com/mnaberez/py65.git synced 2025-01-02 03:29:26 +00:00

Tilde command now works as in VICE (e.g. "~c000").

This commit is contained in:
Mike Naberezny 2009-08-22 11:27:32 -07:00
parent ba12c63666
commit 614a255ee5
2 changed files with 22 additions and 2 deletions

View File

@ -76,8 +76,12 @@ class Monitor(cmd.Cmd):
line = line[:pos]
break
# whitepsace & leading dots
# whitespace & leading dots
line = line.strip(' \t').lstrip('.')
# special case for vice compatibility
if line.startswith('~'):
line = self._shortcuts['~'] + ' ' + line[1:]
# command shortcuts
for shortcut, command in self._shortcuts.iteritems():

View File

@ -232,7 +232,23 @@ class MonitorTests(unittest.TestCase):
out = stdout.getvalue()
self.assertTrue(out.startswith("reset\t"))
# tilde
# tilde
def test_tilde_shortcut_with_space(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon.onecmd('~ $10')
out = stdout.getvalue()
expected = "+16\n$10\n0020\n00010000\n"
self.assertEqual(expected, out)
def test_tilde_shortcut_without_space_for_vice_compatibility(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon.onecmd('~$10')
out = stdout.getvalue()
expected = "+16\n$10\n0020\n00010000\n"
self.assertEqual(expected, out)
def test_do_tilde(self):
stdout = StringIO()