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