Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
prob-teaching-notebooks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
prob-teaching-notebooks
Commits
e82f08a2
Commit
e82f08a2
authored
4 years ago
by
Chris
Browse files
Options
Downloads
Patches
Plain Diff
Name Shadowing beendet
parent
35f66707
Branches
Branches containing commit
No related tags found
1 merge request
!1
Master
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
info4/kapitel-8/Interpreter/test_loop_interpreter.py
+3
-3
3 additions, 3 deletions
info4/kapitel-8/Interpreter/test_loop_interpreter.py
info4/kapitel-8/Interpreter/test_while_interpreter.py
+1
-1
1 addition, 1 deletion
info4/kapitel-8/Interpreter/test_while_interpreter.py
with
4 additions
and
4 deletions
info4/kapitel-8/Interpreter/test_loop_interpreter.py
+
3
−
3
View file @
e82f08a2
...
@@ -234,12 +234,12 @@ class LOOPInterpreterTest(unittest.TestCase):
...
@@ -234,12 +234,12 @@ class LOOPInterpreterTest(unittest.TestCase):
self
.
assertEqual
(
interpret
(
'
x1:=x1-2;
\n
x0:=x1+2
'
),
2
)
self
.
assertEqual
(
interpret
(
'
x1:=x1-2;
\n
x0:=x1+2
'
),
2
)
@mock.patch
(
'
loopinterpreter.input
'
,
side_effect
=
input_exit
)
@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
(
'
x1:=2; BREAK x0:=2
'
),
-
1
)
self
.
assertEqual
(
interpret
(
'
LOOP x1 DO BREAK x2:= 2 END
'
),
-
1
)
self
.
assertEqual
(
interpret
(
'
LOOP x1 DO BREAK x2:= 2 END
'
),
-
1
)
@mock.patch
(
'
loopinterpreter.input
'
,
side_effect
=
input_continue
)
@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
)
self
.
assertEqual
(
interpret
(
'
x1:=2; LOOP x1 DO x0:=x0+2 BREAK END
'
),
4
)
@mock.patch
(
'
lexer.Lexer.__init__
'
,
init_without_tokens
)
@mock.patch
(
'
lexer.Lexer.__init__
'
,
init_without_tokens
)
...
...
This diff is collapsed.
Click to expand it.
info4/kapitel-8/Interpreter/test_while_interpreter.py
+
1
−
1
View file @
e82f08a2
...
@@ -116,5 +116,5 @@ class WHILEInterpreterTest(LOOPInterpreterTest):
...
@@ -116,5 +116,5 @@ class WHILEInterpreterTest(LOOPInterpreterTest):
interpret
(
'
WHILE x1 != 0 DO x0:=2;;x2:=1 END
'
)
interpret
(
'
WHILE x1 != 0 DO x0:=2;;x2:=1 END
'
)
@mock.patch
(
'
whileinterpreter.input
'
,
side_effect
=
str_yes
)
@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
)
self
.
assertEqual
(
interpret
(
'
x1:=100000; WHILE x1 != 0 DO x0:=1; x1:=x1-1 END
'
,
1
),
-
1
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment