mirror of
https://github.com/mnaberez/py65.git
synced 2025-02-06 18:30:26 +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…
x
Reference in New Issue
Block a user