Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pieter Koopman
Personal Prof public repository
Commits
aeab5bbf
Commit
aeab5bbf
authored
Apr 20, 2020
by
Markus Klinik
Browse files
simplify error message
parent
455da912
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/AssignmentSnakeRules.rsc
View file @
aeab5bbf
...
...
@@ -35,7 +35,7 @@ set[Message] aSnake_view_separated(M3 model)
, findClass(model, "Food")
, findClass(model, "World")
};
return { error("<getName(model, shapeClass)>
is part of the user interface and should be moved to SnakeGame
", createdClass)
return { error("<getName(model, shapeClass)>
: only SnakeGame should use shapes
", createdClass)
| createdClass <- createdClasses
, shapeClass <- shapeClasses
, shapeClass in model.extends[createdClass] || shapeClass in allTypeDependenciesLoc(model, createdClass)
...
...
@@ -55,7 +55,7 @@ set[Message] aSnake_controller_separated(M3 model)
, findClass(model, "Food")
, findClass(model, "World")
};
return { error("<getName(model, eventClass)>
is part of the i
nput
and should
be moved to InputHandler
", createdClass)
return { error("<getName(model, eventClass)>
: only I
nput
H
and
ler
should
handle input events
", createdClass)
| createdClass <- createdClasses
, eventClass <- eventClasses
, eventClass in allTypeDependenciesLoc(model, createdClass)
...
...
src/test/AssignmentSnakeRulesSpec.rsc
View file @
aeab5bbf
...
...
@@ -20,8 +20,8 @@ test bool aSnakegraphicsNotInView()
M3 model = loadTestProject("assignment-snake-graphics-not-in-view");
errors = allAssignmentSnakeRules(model);
return
{ "Rectangle
is part of the user interface and should be moved to SnakeGame
"
, "Circle
is part of the user interface and should be moved to SnakeGame
"
{ "Rectangle
: only SnakeGame should use shapes
"
, "Circle
: only SnakeGame should use shapes
"
} == messages(errors);
}
...
...
@@ -30,7 +30,7 @@ test bool aSnakeinputNotInController()
M3 model = loadTestProject("assignment-snake-input-not-in-controller");
errors = allAssignmentSnakeRules(model);
return
{ "KeyEvent
is part of the i
nput
and should
be moved to InputHandler
"
, "MouseEvent
is part of the i
nput
and should
be moved to InputHandler
"
{ "KeyEvent
: only I
nput
H
and
ler
should
handle input events
"
, "MouseEvent
: only I
nput
H
and
ler
should
handle input events
"
} == messages(errors);
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment