Skip to content

Commit

Permalink
Remove question marks from Cypher queries, reflecting newer syntax. I…
Browse files Browse the repository at this point in the history
…ssue #26
  • Loading branch information
jmcvetta committed Oct 4, 2013
1 parent 09d2216 commit 32c2018
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cypher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestCypherParameters(t *testing.T) {
Statement: `
START n = node:name_index(name={startName})
MATCH path = (n)-[r]->(m)
WHERE m.name? = {name}
WHERE m.name = {name}
RETURN id(n), id(r), id(m)
`,
Parameters: map[string]interface{}{
Expand Down Expand Up @@ -159,12 +159,12 @@ func TestCypher(t *testing.T) {
// query := "START x = node:name_index(name=I) MATCH path = (x-[r]-friend) WHERE friend.name = you RETURN TYPE(r)"
type resultStruct struct {
Type string `json:"type(r)"`
Name string `json:"n.name?"`
Age int `json:"n.age?"`
Name string `json:"n.name"`
Age int `json:"n.age"`
}
result := []resultStruct{}
cq := CypherQuery{
Statement: "start x = node(" + strconv.Itoa(n0.Id()) + ") match x -[r]-> n return type(r), n.name?, n.age?",
Statement: "start x = node(" + strconv.Itoa(n0.Id()) + ") match x -[r]-> n return type(r), n.name, n.age",
Result: &result,
}
err := db.Cypher(&cq)
Expand All @@ -175,7 +175,7 @@ func TestCypher(t *testing.T) {
//
// Our test only passes if Neo4j returns columns in the expected order - is
// there any guarantee about order?
expCol := []string{"type(r)", "n.name?", "n.age?"}
expCol := []string{"type(r)", "n.name", "n.age"}
expDat := []resultStruct{
resultStruct{
Type: "know",
Expand Down

0 comments on commit 32c2018

Please sign in to comment.