Commit e7234948 authored by Markus Klinik's avatar Markus Klinik
Browse files

remove word "exactiy" from error message

it's more confusing than it helps
parent fa229deb
......@@ -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);
......
......@@ -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
......
......@@ -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
......@@ -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 };
}
......
......@@ -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)|);
}
......
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