mirror of
https://github.com/mnaberez/py65.git
synced 2024-06-10 17:29:34 +00:00
Add tests for conversion errors
This commit is contained in:
parent
df0478f70a
commit
a3d74489a9
|
@ -840,6 +840,22 @@ class MonitorTests(unittest.TestCase):
|
|||
expected = "~ <number>"
|
||||
self.assertTrue(out.startswith(expected))
|
||||
|
||||
def test_do_tilde_with_bad_label_shows_error(self):
|
||||
stdout = StringIO()
|
||||
mon = Monitor(stdout=stdout)
|
||||
mon.do_tilde('bad_label')
|
||||
out = stdout.getvalue()
|
||||
expected = "Bad label: bad_label"
|
||||
self.assertTrue(out.startswith(expected))
|
||||
|
||||
def test_do_tilde_with_overflow_shows_error(self):
|
||||
stdout = StringIO()
|
||||
mon = Monitor(stdout=stdout)
|
||||
mon.do_tilde('$FFFFFFFFFFFF')
|
||||
out = stdout.getvalue()
|
||||
expected = "Overflow error: $FFFFFFFFFFFF"
|
||||
self.assertTrue(out.startswith(expected))
|
||||
|
||||
def test_help_tilde(self):
|
||||
stdout = StringIO()
|
||||
mon = Monitor(stdout=stdout)
|
||||
|
|
Loading…
Reference in New Issue
Block a user