Skip to content

Commit

Permalink
Show help for fill when no arguments are given
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaberez committed Feb 6, 2012
1 parent 2da902c commit 496ace9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/py65/monitor.py
Expand Up @@ -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:])
Expand Down
21 changes: 19 additions & 2 deletions src/py65/tests/test_monitor.py
Expand Up @@ -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

Expand Down

0 comments on commit 496ace9

Please sign in to comment.