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

Add "q" as a shortcut for "quit"

This commit is contained in:
Mike Naberezny 2012-01-10 09:58:45 -08:00
parent 7b48d3e794
commit b55d045eff
2 changed files with 74 additions and 65 deletions

View File

@ -127,6 +127,7 @@ class Monitor(cmd.Cmd):
'g': 'goto',
'l': 'load',
'm': 'mem',
'q': 'quit',
'r': 'registers',
'ret': 'return',
'rad': 'radix',

View File

@ -337,7 +337,7 @@ class MonitorTests(unittest.TestCase):
# quit
def test_shortcut_for_quit(self):
def test_shortcut_x_for_quit(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon.do_help('x')
@ -345,6 +345,14 @@ class MonitorTests(unittest.TestCase):
out = stdout.getvalue()
self.assertTrue(out.startswith('To quit'))
def test_shortcut_q_for_quit(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon.do_help('q')
out = stdout.getvalue()
self.assertTrue(out.startswith('To quit'))
def test_do_EOF(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)