mirror of
https://github.com/mnaberez/py65.git
synced 2025-01-01 11:29:32 +00:00
Show an error message if load command has no args
This commit is contained in:
parent
9f5cd2e425
commit
1b639ebfd0
@ -560,7 +560,7 @@ class Monitor(cmd.Cmd):
|
||||
|
||||
def do_load(self, args):
|
||||
split = shlex.split(args)
|
||||
if len(split) > 2:
|
||||
if len(split) not in (1, 2):
|
||||
self._output("Syntax error: %s" % args)
|
||||
return
|
||||
|
||||
|
@ -541,6 +541,13 @@ class MonitorTests(unittest.TestCase):
|
||||
out = stdout.getvalue()
|
||||
self.assertTrue(out.startswith('load'))
|
||||
|
||||
def test_load_with_less_than_two_args_syntax_error(self):
|
||||
stdout = StringIO()
|
||||
mon = Monitor(stdout=stdout)
|
||||
mon.do_load('')
|
||||
out = stdout.getvalue()
|
||||
self.assertTrue(out.startswith('Syntax error'))
|
||||
|
||||
def test_load_with_more_than_two_args_syntax_error(self):
|
||||
stdout = StringIO()
|
||||
mon = Monitor(stdout=stdout)
|
||||
|
Loading…
Reference in New Issue
Block a user