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

Name Shadowing beendet

parent 35f66707
......@@ -234,15 +234,15 @@ class LOOPInterpreterTest(unittest.TestCase):
self.assertEqual(interpret('x1:=x1-2;\n x0:=x1+2'), 2)
@mock.patch('loopinterpreter.input', side_effect=input_exit)
def test_break_exit(self, input):
def test_break_exit(self, custom_input):
self.assertEqual(interpret('x1:=2; BREAK x0:=2'), -1)
self.assertEqual(interpret('LOOP x1 DO BREAK x2:= 2 END'), -1)
@mock.patch('loopinterpreter.input', side_effect=input_continue)
def test_break_continue(self, input):
def test_break_continue(self, custom_input):
self.assertEqual(interpret('x1:=2; LOOP x1 DO x0:=x0+2 BREAK END'), 4)
@mock.patch('lexer.Lexer.__init__', init_without_tokens)
def test_unknown_tokens(self):
with self.assertRaises(SyntaxError):
interpret('BLIBLABLUB')
\ No newline at end of file
interpret('BLIBLABLUB')
......@@ -116,5 +116,5 @@ class WHILEInterpreterTest(LOOPInterpreterTest):
interpret('WHILE x1 != 0 DO x0:=2;;x2:=1 END')
@mock.patch('whileinterpreter.input', side_effect=str_yes)
def test_infinite_loop(self, input):
def test_infinite_loop(self, custom_input):
self.assertEqual(interpret('x1:=100000; WHILE x1 != 0 DO x0:=1; x1:=x1-1 END', 1), -1)
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