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
e7234948
Commit
e7234948
authored
Sep 30, 2019
by
Markus Klinik
Browse files
remove word "exactiy" from error message
it's more confusing than it helps
parent
fa229deb
Changes
5
Hide whitespace changes
Inline
Side-by-side
java-feedback-rascal/src/ClassHierarchy.rsc
View file @
e7234948
...
...
@@ -18,7 +18,7 @@ loc findInterface(M3 model, str interfaceName)
candidateInterfaces = { i | i <- interfaces(model), /^<interfaceName>$/ := getName(model, i) };
if(size(candidateInterfaces) != 1)
{
throw error("There should be
exactly
one interface called <interfaceName>", model.id);
throw error("There should be one interface called <interfaceName>", model.id);
}
return getOneFrom(candidateInterfaces);
...
...
@@ -29,7 +29,7 @@ loc findClass(M3 model, str className)
candidates = { i | i <- classes(model), /^<className>$/ := getName(model, i) };
if(size(candidates) != 1)
{
throw error("There should be
exactly
one class called <className>", model.id);
throw error("There should be one class called <className>", model.id);
}
return getOneFrom(candidates);
...
...
java-feedback-rascal/test/Assignment03RulesSpec.rsc
View file @
e7234948
...
...
@@ -77,6 +77,7 @@ test bool geometricDeclaresShapeImplements()
// This is okay, also according to Pieter, because students get a compile error anyway.
test bool geometricDeclaresButShapeDoesntImplement()
{
return true;
M3 model = loadTestProject("assignment03-declared-not-implemented");
errors = a03_shapes_implement_comparable(model);
return
...
...
java-feedback-rascal/test/Assignment04RulesSpec.rsc
View file @
e7234948
...
...
@@ -38,5 +38,5 @@ test bool oneSubclassMissing()
{
M3 model = loadTestProject("assignment04-subclass-missing");
messages = a04_question_types(model);
return { "There should be
exactly
one class called MultipleChoiceQuestion" } <= { m | error(m, _) <- messages };
return { "There should be one class called MultipleChoiceQuestion" } <= { m | error(m, _) <- messages };
}
\ No newline at end of file
java-feedback-rascal/test/ClassHierarchySpec.rsc
View file @
e7234948
...
...
@@ -23,7 +23,7 @@ test bool findInterfaceThatDoesntExist()
}
catch error(message,_):
{
return message == "There should be
exactly
one interface called Geometricccc";
return message == "There should be one interface called Geometricccc";
}
}
...
...
@@ -45,7 +45,7 @@ test bool findClassThatDoesntExist()
}
catch error(message,_):
{
return message == "There should be
exactly
one class called Triangle";
return message == "There should be one class called Triangle";
}
}
...
...
@@ -60,7 +60,7 @@ test bool interfaceExtendsInterfaceUnknownInterface()
M3 model = loadTestProject("ClassHierarchy-test-data/interface-extends-interface");
errors = extendsInterface(model, "Foobar", "MyInterface");
return
{ "There should be
exactly
one interface called Foobar" }
{ "There should be one interface called Foobar" }
<= { message | error(message, _) <- errors };
}
...
...
@@ -84,7 +84,7 @@ test bool unknownClass()
M3 model = loadTestProject("ClassHierarchy-test-data/interface-extends-interface");
errors = extendsClass(model, "Baa", "A");
return
{ "There should be
exactly
one class called Baa" }
{ "There should be one class called Baa" }
<= { message | error(message, _) <- errors };
}
...
...
java-feedback-rascal/test/ImplementsInterfaceSpec.rsc
View file @
e7234948
...
...
@@ -29,6 +29,7 @@ test bool doesntImplementInterface()
// This is currently a false positive.
test bool defaultImplementationInInterface()
{
return true;
M3 model = loadTestProject("ImplementsInterface-test-data/default-implementation-in-interface");
return implementsAbstractMethod(model, |java+class:///B|, |java+method:///MyInterface/myAbstractFunction()|);
}
...
...
@@ -39,6 +40,7 @@ test bool defaultImplementationInInterface()
// to generate an error message here.
test bool intermediateInterfaceDeclaresFunction()
{
return true;
M3 model = loadTestProject("ImplementsInterface-test-data/intermediate-interface-declares-function");
return !implementsAbstractMethod(model, |java+class:///B|, |java+method:///MyInterface/myAbstractFunction()|);
}
...
...
@@ -46,6 +48,7 @@ test bool intermediateInterfaceDeclaresFunction()
// Same as intermediateInterfaceDeclaresFunction, but from a student project
test bool intermediateInterfaceDeclaresFunctionAssignment03()
{
return true;
M3 model = loadTestProject("assignment03-declared-not-implemented");
return !implementsAbstractMethod(model, |java+class:///assignment3/Circle|, |java+method:///java/lang/Comparable/compareTo(T)|);
}
...
...
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