Commit 11d51710 authored by Louise Söderström's avatar Louise Söderström
Browse files

Fixed error message for multiple relationship types

Now identical with old error message
parent 5bce2390
Showing with 5 additions and 5 deletions
+5 -5
......@@ -62,7 +62,7 @@ class HelpfulErrorMessagesTest extends ExecutionEngineFunSuite with NewPlannerTe
test("should provide sensible error message when trying to add multiple relationship types on create") {
withEachPlanner { execute =>
val exception = intercept[SyntaxException] (execute("CREATE (a)-[:ASSOCIATED_WITH|:KNOWS]->(b)", Seq.empty))
exception.getMessage should include("A single relationship type must be specified for CREATE.")
exception.getMessage should include("A single relationship type must be specified for CREATE")
}
}
......@@ -77,7 +77,7 @@ class HelpfulErrorMessagesTest extends ExecutionEngineFunSuite with NewPlannerTe
test("should provide sensible error message when trying to add multiple relationship types on merge") {
withEachPlanner { execute =>
val exception = intercept[SyntaxException] (execute("MERGE (a)-[:ASSOCIATED_WITH|:KNOWS]->(b)", Seq.empty))
exception.getMessage should include("A single relationship type must be specified for MERGE.")
exception.getMessage should include("A single relationship type must be specified for MERGE")
}
}
}
......@@ -217,7 +217,7 @@ case class Merge(pattern: Pattern, actions: Seq[MergeAction])(val position: Inpu
pattern.patternParts.foldSemanticCheck {
case EveryPath(RelationshipChain(_, rel, _)) if rel.types.size != 1 =>
if (rel.types.size > 1) {
SemanticError("A single relationship type must be specified for MERGE.", rel.position)
SemanticError("A single relationship type must be specified for MERGE", rel.position)
} else {
SemanticError("Exactly one relationship type must be specified for MERGE. Did you forget to prefix your relationship type with a ':'?", rel.position)
}
......@@ -235,7 +235,7 @@ case class Create(pattern: Pattern)(val position: InputPosition) extends UpdateC
pattern.patternParts.foldSemanticCheck {
case EveryPath(RelationshipChain(_, rel, _)) if rel.types.size != 1 =>
if (rel.types.size > 1) {
SemanticError("A single relationship type must be specified for CREATE.", rel.position)
SemanticError("A single relationship type must be specified for CREATE", rel.position)
} else {
SemanticError("Exactly one relationship type must be specified for CREATE. Did you forget to prefix your relationship type with a ':'?", rel.position)
}
......
......@@ -145,7 +145,7 @@ case class SpecSuiteErrorHandler(typ: String, phase: String, detail: String) ext
detail should equal(NON_CONSTANT_EXPRESSION)
else if (msg.matches("Can't use non-deterministic \\(random\\) functions inside of aggregate functions\\."))
detail should equal(NON_CONSTANT_EXPRESSION)
else if (msg.matches(semanticError("A single relationship type must be specified for ((CREATE)|(MERGE))\\.")) ||
else if (msg.matches(semanticError("A single relationship type must be specified for ((CREATE)|(MERGE))\\")) ||
msg.matches(semanticError("Exactly one relationship type must be specified for ((CREATE)|(MERGE))\\. " +
"Did you forget to prefix your relationship type with a \\'\\:\\'\\?")))
detail should equal(NO_SINGLE_RELATIONSHIP_TYPE)
......
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