From e130d72e1450e011f24b3e7fbc56a7d9e68cc11a Mon Sep 17 00:00:00 2001 From: Chris <Christopher.Happe@uni-duesseldorf.de> Date: Wed, 18 Nov 2020 12:38:15 +0100 Subject: [PATCH] =?UTF-8?q?Test=20f=C3=BCr=20zu=20viele=20Ends=20hinzugef?= =?UTF-8?q?=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- info4/kapitel-8/Interpreter/test_loop_interpreter.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/info4/kapitel-8/Interpreter/test_loop_interpreter.py b/info4/kapitel-8/Interpreter/test_loop_interpreter.py index 7f47bce..125ffd9 100644 --- a/info4/kapitel-8/Interpreter/test_loop_interpreter.py +++ b/info4/kapitel-8/Interpreter/test_loop_interpreter.py @@ -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') -- GitLab