Permalink
Browse files

Show help for fill when no arguments are given

  • Loading branch information...
mnaberez committed Feb 6, 2012
1 parent 2da902c commit 496ace9db0b79d05b1b72df37c10c4ef99c78420
Showing with 20 additions and 4 deletions.
  1. +1 −2 src/py65/monitor.py
  2. +19 −2 src/py65/tests/test_monitor.py
View
@@ -566,8 +566,7 @@ def help_fill(self):
def do_fill(self, args):
split = shlex.split(args)
if len(split) < 2:
- self._output("Syntax error: %s" % args)
- return
+ return self.help_fill()
start, end = self._address_parser.range(split[0])
filler = map(self._address_parser.number, split[1:])
@@ -291,15 +291,32 @@ def test_shortcut_f_for_fill(self):
mon.do_help('f')
out = stdout.getvalue()
- self.assertTrue(out.startswith('fill'))
+ self.assertTrue(out.startswith('fill <address_range>'))
def test_shortcut_gt_for_fill(self):
stdout = StringIO()
mon = Monitor(stdout=stdout)
mon.do_help('>')
out = stdout.getvalue()
- self.assertTrue(out.startswith('fill'))
+ self.assertTrue(out.startswith('fill <address_range>'))
+
+ def test_help_fill(self):
+ stdout = StringIO()
+ mon = Monitor(stdout=stdout)
+ mon.help_fill()
+
+ out = stdout.getvalue()
+ self.assertTrue(out.startswith('fill <address_range>'))
+
+ def test_do_fill_with_no_args_shows_help(self):
+ stdout = StringIO()
+ mon = Monitor(stdout=stdout)
+ mon.do_fill('')
+
+ out = stdout.getvalue()
+ self.assertTrue(out.startswith('fill <address_range>'))
+
# goto

0 comments on commit 496ace9

Please sign in to comment.