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:
parent
ba12c63666
commit
614a255ee5
@ -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():
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user