Skip to content

Commit

Permalink
Merge pull request #10184 from sherfert/3.3-fix-paths
Browse files Browse the repository at this point in the history
Fixing a broken test, adding toString to paths
  • Loading branch information
craigtaverner committed Oct 11, 2017
2 parents d095c05 + 2750cf3 commit f55c599
Showing 1 changed file with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class PatternExpressionImplementationAcceptanceTest extends ExecutionEngineFunSu
result.toList.head("p").asInstanceOf[Long] should equal(42)
}

ignore("match (n) return case when n:A then (n)-->(:C) when n:B then (n)-->(:D) else 42 end as p") {
test("match (n) return case when n:A then (n)-->(:C) when n:B then (n)-->(:D) else 42 end as p") {
val start = createLabeledNode("A")
val c = createLabeledNode("C")
val rel1 = relate(start, c)
Expand All @@ -67,16 +67,12 @@ class PatternExpressionImplementationAcceptanceTest extends ExecutionEngineFunSu
.map(_.mapValues {
case l: Seq[Any] => l.toSet
case x => x
}).toList

val head = result.head
val bool = head == Set(new PathImpl(start, rel2, c), new PathImpl(start, rel1, c))
print(bool)
}).toSet

result should equal(List(
Map("p" -> Set(new PathImpl(start, rel2, c), new PathImpl(start, rel1, c))),
result should equal(Set(
Map("p" -> Set(PathImpl(start, rel2, c), PathImpl(start, rel1, c))),
Map("p" -> 42),
Map("p" -> Set(new PathImpl(start2, rel4, d), new PathImpl(start2, rel3, d))),
Map("p" -> Set(PathImpl(start2, rel4, d), PathImpl(start2, rel3, d))),
Map("p" -> 42)
))
}
Expand Down Expand Up @@ -126,8 +122,8 @@ class PatternExpressionImplementationAcceptanceTest extends ExecutionEngineFunSu
}).toSet

result should equal(Set(
Map("c" -> 1, "p" -> Set(new PathImpl(start, rel2, c), new PathImpl(start, rel1, c))),
Map("c" -> 1, "p" -> Set(new PathImpl(start2, rel4, d), new PathImpl(start2, rel3, d))),
Map("c" -> 1, "p" -> Set(PathImpl(start, rel2, c), PathImpl(start, rel1, c))),
Map("c" -> 1, "p" -> Set(PathImpl(start2, rel4, d), PathImpl(start2, rel3, d))),
Map("c" -> 2, "p" -> 42)
))
}
Expand Down Expand Up @@ -234,7 +230,7 @@ class PatternExpressionImplementationAcceptanceTest extends ExecutionEngineFunSu
relate(start, createNode())
relate(start, createNode())

executeWith(Configs.CommunityInterpreted, "match (n) return case when id(n) >= 0 then (n)-->() else 42 end as p",
executeWith(Configs.CommunityInterpreted, "match (n) return case when id(n) >= 0 then (n)-->() else 42 end as p",
planComparisonStrategy = ComparePlansWithAssertion(_ shouldNot useOperators("Expand(All)")))
}

Expand Down

0 comments on commit f55c599

Please sign in to comment.