Commit e130d72e authored by Christopher Happe's avatar Christopher Happe
Browse files

Test für zu viele Ends hinzugefügt

parent 5fdca0d9
......@@ -132,6 +132,16 @@ class LOOPInterpreterTest(unittest.TestCase):
with self.assertRaises(SyntaxError):
interpret(';x1:=x1+1')
def test_syntax_unnecessary_end(self):
with self.assertRaises(SyntaxError):
interpret('LOOP x0 DO x1:=x1+1 END END')
with self.assertRaises(SyntaxError):
interpret('LOOP x0 DO x1:=x1+1 END; x1:=x1+1 END')
with self.assertRaises(SyntaxError):
interpret('x1:=x1+1; END x1:=x1+1')
with self.assertRaises(SyntaxError):
interpret('END x1:=x1+1')
def test_syntax_missing_semicolon(self):
with self.assertRaises(SyntaxError):
interpret('x0:=2 LOOP x0 DO x1:=x1+1 END')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment