Permalink
Browse files

Added test for SET

  • Loading branch information...
1 parent 5457984 commit 6372ca6f36f50e00035c363f1b5ed1b5bbbf3ffd @systay committed Jun 19, 2012
Showing with 16 additions and 2 deletions.
  1. +16 −2 cypher/src/test/scala/org/neo4j/cypher/ErrorMessagesTest.scala
@@ -190,11 +190,25 @@ class ErrorMessagesTest extends ExecutionEngineHelper with Assertions with Strin
"Unknown identifier `missing`")
}
+ @Test def missing_set_dependency_correctly_reported() {
+ expectError(
+ "START a=node(0) SET a.name = missing RETURN a",
+ "Unknown identifier `missing`")
+ }
+
private def expectError[T <: CypherException](query: String, expectedError: String)(implicit manifest: Manifest[T]): T = {
val error = intercept[T](engine.execute(query).toList)
- val s = query + "\n" + error.toString()
- assertTrue(s, error.getMessage.contains(expectedError))
+ val s = """
+Wrong error message produced: %s
+Expected: %s
+ Got: %s
+""".format(query, expectedError, error)
+
+
+ if(!error.getMessage.contains(expectedError)) {
+ fail(s)
+ }
error
}

0 comments on commit 6372ca6

Please sign in to comment.