test many jumps

This commit is contained in:
Peter McGoron 2023-02-20 18:48:20 +00:00
parent 3dd29b1004
commit 5a09f481b3
1 changed files with 19 additions and 0 deletions

View File

@ -370,6 +370,25 @@ class LabelTest(unittest.TestCase):
self.assertEqual(ex.getreg(1), 50)
self.assertEqual(ex.getreg(2), 50*50)
def test_many_jumps(self):
p = Program()
p.parse_lines([
"j .f1",
".f4",
"j .f5",
".f2",
"j .f3",
".f3",
"j .f4",
".f5",
"j .f6",
".f1",
"j .f2",
".f6"
])
ex = ffi.Environment(p())
self.assertEqual(ex(), ffi.RunRet.STOP)
class ProgramTest(unittest.TestCase):
def test_exec_simple_reg(self):
p = Program()